{"id":18751,"date":"2023-10-03T15:30:32","date_gmt":"2023-10-03T15:30:32","guid":{"rendered":"https:\/\/hivepress.io\/?p=18751"},"modified":"2023-10-03T15:30:33","modified_gmt":"2023-10-03T15:30:33","slug":"add-social-login-to-wordpress-directory-website","status":"publish","type":"post","link":"https:\/\/hivepress.io\/blog\/add-social-login-to-wordpress-directory-website\/","title":{"rendered":"How to Add Social Login to Your WordPress Directory Website"},"content":{"rendered":"\n<p>Forward-looking businesses are always searching for ways to increase conversion rates, so they care about the user experience on their website. That&#8217;s why many companies are using social login, also known as a social sign-on feature, on their websites.<\/p>\n\n\n\n<p>For website visitors, social login means that they can skip the registration procedures required to create a new account and can simply sign in with one click. It&#8217;s a truly convenient alternative to the traditional registration forms that improve UX.<\/p>\n\n\n\n<p>At the same time, for website owners, social login is a useful feature that can help simplify user verification while also providing more reliable access to user data for personalization<em>.<\/em><\/p>\n\n\n\n<p>In this short tutorial, we\u2019ll show you how to set up the <a href=\"https:\/\/hivepress.io\/extensions\/social-login\/?utm_medium=referral&amp;utm_source=blog\" target=\"_blank\" rel=\"noreferrer noopener\">HivePress Social Login extension<\/a> so you can allow your website visitors to sign in via Facebook and Google. We\u2019ll explain step-by-step how to get Facebook App ID and Google Client ID and correctly integrate them with your website.<\/p>\n\n\n\n<p>Before we begin, it&#8217;s important to note that the Social Login extension is based on <a href=\"https:\/\/wordpress.org\/plugins\/hivepress\/\" target=\"_blank\" rel=\"noreferrer noopener\">HivePress<\/a>, a free WordPress directory plugin, and can be used only on HivePress-powered websites. So in this walkthrough, we&#8217;re going to use the HivePress plugin along with its default multipurpose WordPress theme, <a href=\"https:\/\/hivepress.io\/themes\/listinghive\/?utm_medium=referral&amp;utm_source=blog\" target=\"_blank\" rel=\"noreferrer noopener\">ListingHive<\/a>.<\/p>\n\n\n\n<p>Let\u2019s get started!<\/p>\n\n\n\n<div class=\"message is-info\"><p> Feel free to check our <a href=\"https:\/\/hivepress.io\/blog\/how-to-create-a-directory-website-with-wordpress\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>tutorial<\/strong> <\/a>on how to create a directory website with WordPress for free and without any coding skills. <\/p><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Installing the Social Login Add-on<\/h2>\n\n\n\n<p>First of all, you need to install the Social Login extension by going to the <strong>WP Dashboard &gt; Plugins &gt; Add New<\/strong> <strong>&gt; Upload Plugin<\/strong> section. Then select the extension ZIP file, install it and proceed by activating the extension.<\/p>\n\n\n\n<p>Once you install the add-on, you need to select the authentication methods for your website. To do that, go to the <strong>WP Dashboard &gt;<\/strong> <strong>HivePress &gt; Settings &gt; Users<\/strong> section and select one of the available methods. If you want to allow users to sign in either via Facebook and Google, it\u2019s necessary to select both methods and save changes, as shown in the screenshot below.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"596\" src=\"https:\/\/hivepress.io\/wp-content\/uploads\/2021\/08\/Social-login_0.jpg\" alt=\"Adding authentication methods to the WordPress business directory website.\" class=\"wp-image-18752\" srcset=\"https:\/\/hivepress.io\/wp-content\/uploads\/2021\/08\/Social-login_0.jpg 750w, https:\/\/hivepress.io\/wp-content\/uploads\/2021\/08\/Social-login_0-300x238.jpg 300w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\n\n\n\n<p>After you select the authentication methods for your website, you can proceed to the next step.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Adding Facebook Login Button<\/h2>\n\n\n\n<p>In order to add the \u201cLog in with Facebook\u201d button to your website, you need to get a unique App ID from Facebook first. This ID links your website with Facebook and allows you to request the Facebook profile details <em>(e.g., the email address)<\/em> required for logging users in.<\/p>\n\n\n\n<p>So, let\u2019s move to the first step.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Registering on Facebook<\/h3>\n\n\n\n<p>Before creating a Facebook App, you have to register a Facebook Developer account. To do that, navigate to the <a href=\"https:\/\/developers.facebook.com\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">Facebook for Developers<\/a> page and click on the <strong>Log In<\/strong> or <strong>Get Started<\/strong> buttons. Then, you need to sign in with your FB account to proceed. Once you verify your account, you can move to the next step.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Creating an App<\/h3>\n\n\n\n<p>Once you finish the registration, you can go to the <strong>App Dashboard<\/strong> to create your first app. Simply click on the <strong>Create App<\/strong> button.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"382\" src=\"https:\/\/hivepress.io\/wp-content\/uploads\/2021\/08\/Social-login_1.jpg\" alt=\"Creating a new Facebook app.\" class=\"wp-image-18754\" srcset=\"https:\/\/hivepress.io\/wp-content\/uploads\/2021\/08\/Social-login_1.jpg 750w, https:\/\/hivepress.io\/wp-content\/uploads\/2021\/08\/Social-login_1-300x153.jpg 300w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\n\n\n\n<p>Then, you have to choose what you want your app to do. For the purposes of this tutorial, you have to select \u201cAllow people to log in with their Facebook account\u201d and then proceed.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"996\" height=\"611\" src=\"https:\/\/hivepress.io\/wp-content\/uploads\/2023\/10\/app-purpose-FB.jpg\" alt=\"Creating Facebook App.\" class=\"wp-image-32794\" srcset=\"https:\/\/hivepress.io\/wp-content\/uploads\/2023\/10\/app-purpose-FB.jpg 996w, https:\/\/hivepress.io\/wp-content\/uploads\/2023\/10\/app-purpose-FB-300x184.jpg 300w, https:\/\/hivepress.io\/wp-content\/uploads\/2023\/10\/app-purpose-FB-768x471.jpg 768w\" sizes=\"auto, (max-width: 996px) 100vw, 996px\" \/><\/figure>\n\n\n\n<p>Next, you need to set the app name <em>(e.g., your website name)<\/em> and enter your valid email since all the developer notifications will be sent there <em>(you don\u2019t have to mention the Business Manager account if you don\u2019t have one). <\/em>Finally, click on the <strong>Create App<\/strong> button.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1000\" height=\"468\" src=\"https:\/\/hivepress.io\/wp-content\/uploads\/2023\/10\/app-name.png\" alt=\"Adding Facebook App name.\" class=\"wp-image-32795\" srcset=\"https:\/\/hivepress.io\/wp-content\/uploads\/2023\/10\/app-name.png 1000w, https:\/\/hivepress.io\/wp-content\/uploads\/2023\/10\/app-name-300x140.png 300w, https:\/\/hivepress.io\/wp-content\/uploads\/2023\/10\/app-name-768x359.png 768w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><\/figure>\n\n\n\n<p>Once you are in your Dashboard, go to the <strong>App Settings > Basic<\/strong> section.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"529\" src=\"https:\/\/hivepress.io\/wp-content\/uploads\/2023\/10\/App-settings-FB-1024x529.jpg\" alt=\"Facebook App basic settings.\" class=\"wp-image-32798\" srcset=\"https:\/\/hivepress.io\/wp-content\/uploads\/2023\/10\/App-settings-FB-1024x529.jpg 1024w, https:\/\/hivepress.io\/wp-content\/uploads\/2023\/10\/App-settings-FB-300x155.jpg 300w, https:\/\/hivepress.io\/wp-content\/uploads\/2023\/10\/App-settings-FB-768x397.jpg 768w, https:\/\/hivepress.io\/wp-content\/uploads\/2023\/10\/App-settings-FB.jpg 1511w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>On the settings page, you have to:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Enter your website domain.<\/li>\n\n\n\n<li>Indicate the Privacy Policy URL so users can read it before logging in.<\/li>\n\n\n\n<li>Specify the Data Deletion Instructions <em>(a page with info on how your website visitors can get their data deleted)<\/em>.&nbsp;<\/li>\n\n\n\n<li>Finally, select the category that your website belongs to.<\/li>\n<\/ul>\n\n\n\n<p>Once you add all the required details, save the changes. Then, you should go to the <strong>Go Live<\/strong> section and click on the \u201cGo Live\u201d button <em>(please note that there will be a \u201cverification step\u201d that you also have to complete before you can go live).<\/em><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"751\" height=\"808\" src=\"https:\/\/hivepress.io\/wp-content\/uploads\/2023\/10\/Live-section.png\" alt=\"Facebook App - settings.\" class=\"wp-image-32797\" srcset=\"https:\/\/hivepress.io\/wp-content\/uploads\/2023\/10\/Live-section.png 751w, https:\/\/hivepress.io\/wp-content\/uploads\/2023\/10\/Live-section-279x300.png 279w\" sizes=\"auto, (max-width: 751px) 100vw, 751px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Enabling Social Login<\/h3>\n\n\n\n<p>Now, go back one more time to the <strong>App Settings > Basic<\/strong> sections and copy your App ID and App Secret. Then, navigate to your <strong>WP Dashboard > HivePress > Settings > Integrations<\/strong> section and paste your ID and Key into the corresponding fields.\u00a0<\/p>\n\n\n\n<p>Don\u2019t forget to save the changes.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"243\" src=\"https:\/\/hivepress.io\/wp-content\/uploads\/2023\/10\/HP-integrations-1024x243.jpg\" alt=\"HivePress Integrations settings.\" class=\"wp-image-32799\" srcset=\"https:\/\/hivepress.io\/wp-content\/uploads\/2023\/10\/HP-integrations-1024x243.jpg 1024w, https:\/\/hivepress.io\/wp-content\/uploads\/2023\/10\/HP-integrations-300x71.jpg 300w, https:\/\/hivepress.io\/wp-content\/uploads\/2023\/10\/HP-integrations-768x182.jpg 768w, https:\/\/hivepress.io\/wp-content\/uploads\/2023\/10\/HP-integrations.jpg 1189w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Please note that if you don\u2019t see the \u201cFacebook\u201d section there, then you have to go to the <strong>WP Dashboard > HivePress > Settings > Users <\/strong>section and select Facebook in the<strong> Authentication Methods <\/strong>field.<br>That\u2019s it! Now, there should be a Facebook button in your sign-in form that allows users to sign in to your website via their Facebook accounts. However, you may have to wait a few minutes before changes will take place.<\/p>\n\n\n\n<p>Now, let\u2019s move to the next part of this tutorial to create and add the Google Login button.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Adding Google Login Button<\/h2>\n\n\n\n<p>If you want to add the &#8220;Log In with Google&#8221; button to your HivePress-powered website, you need to get a unique Client ID from Google that will link your website with the Google authentication API. So, let\u2019s do it!<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Creating a New Project<\/h3>\n\n\n\n<p>The first step is to create a new Google API project <em>(you may use an existing project if you already have one).<\/em> To do that, go to the <a href=\"https:\/\/console.developers.google.com\/apis\/dashboard\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">Google API Console<\/a> and click on the <strong>Create Project<\/strong> button. Then you need to enter the name of your project and click on the <strong>Create<\/strong> button.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"278\" src=\"https:\/\/hivepress.io\/wp-content\/uploads\/2021\/08\/Social-login_10.jpg\" alt=\"Creating a new Google API project.\" class=\"wp-image-18764\" srcset=\"https:\/\/hivepress.io\/wp-content\/uploads\/2021\/08\/Social-login_10.jpg 750w, https:\/\/hivepress.io\/wp-content\/uploads\/2021\/08\/Social-login_10-300x111.jpg 300w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\n\n\n\n<p>Now you have to go to the <strong>OAuth consent screen<\/strong> section and select the OAuth consent screen option <em>(internal or external)<\/em> according to your website requirements. For the sake of this tutorial, we\u2019ll choose the <strong>External <\/strong>option.<\/p>\n\n\n\n<p>Then you\u2019ll be redirected to the App Registration form. Within this form, you need to:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Set the App name<em> (e.g., your website name)<\/em>.<\/li>\n\n\n\n<li>Indicate user support email and developer\u2019s email<em> <\/em>so Google can notify you about any changes to your project.<\/li>\n\n\n\n<li>Specify links to your homepage, privacy policy page and the link to your terms of service page.<\/li>\n\n\n\n<li>Finally, add your website domain.<\/li>\n<\/ul>\n\n\n\n<p>When finished, click on the <strong>Save<\/strong> button. You may skip the other steps within the registration form and come back to your Dashboard.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"932\" src=\"https:\/\/hivepress.io\/wp-content\/uploads\/2021\/08\/Social-login_12.jpg\" alt=\"Filling out details in the Google OAuth consent screen page.\" class=\"wp-image-18772\" srcset=\"https:\/\/hivepress.io\/wp-content\/uploads\/2021\/08\/Social-login_12.jpg 750w, https:\/\/hivepress.io\/wp-content\/uploads\/2021\/08\/Social-login_12-241x300.jpg 241w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\n\n\n\n<p>The next step is to create API credentials, namely &#8211; OAuth Client ID. You can do so by going to the <strong>Credentials &gt;<\/strong> <strong>Create Credentials &gt; OAuth Client ID<\/strong> section.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"287\" src=\"https:\/\/hivepress.io\/wp-content\/uploads\/2021\/08\/Social-login_11-2.jpg\" alt=\"Creating Google API credentials.\" class=\"wp-image-18773\" srcset=\"https:\/\/hivepress.io\/wp-content\/uploads\/2021\/08\/Social-login_11-2.jpg 750w, https:\/\/hivepress.io\/wp-content\/uploads\/2021\/08\/Social-login_11-2-300x115.jpg 300w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\n\n\n\n<p>Within this section, you need to fill in the name field and enter your website\u2019s URL in the \u201cAuthorized JavaScript origins\u201d field. Optionally, you can fill in the \u201cAuthorized redirect URLs\u201d field if you want to specify the path where users will be redirected after they\u2019ve logged in with Google.<\/p>\n\n\n\n<p>Once you are done, click on the <strong>Save<\/strong> button.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"810\" src=\"https:\/\/hivepress.io\/wp-content\/uploads\/2021\/08\/Social-login_13.jpg\" alt=\"Filling out details necessary for creating new credentials.\" class=\"wp-image-18774\" srcset=\"https:\/\/hivepress.io\/wp-content\/uploads\/2021\/08\/Social-login_13.jpg 750w, https:\/\/hivepress.io\/wp-content\/uploads\/2021\/08\/Social-login_13-278x300.jpg 278w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Enabling Social Login<\/h3>\n\n\n\n<p>Finally, you got a unique client ID. Now you need to copy and paste it in the <strong>WP Dashboard &gt; HivePress &gt; Settings &gt; Integrations &gt; Client ID <\/strong>section. Don\u2019t forget to save changes.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"425\" src=\"https:\/\/hivepress.io\/wp-content\/uploads\/2021\/08\/Social-login_14.jpg\" alt=\"Adding Google Client ID to the WordPress business directory website.\" class=\"wp-image-18776\" srcset=\"https:\/\/hivepress.io\/wp-content\/uploads\/2021\/08\/Social-login_14.jpg 750w, https:\/\/hivepress.io\/wp-content\/uploads\/2021\/08\/Social-login_14-300x170.jpg 300w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>That\u2019s it! By following the steps above, you can easily set up the Social Login extension and allow your users to log in via third-party services like Facebook and Google. Once you complete all the steps, you&#8217;ll have the same Facebook and Google buttons in the login form, as shown in the screenshot below.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"843\" src=\"https:\/\/hivepress.io\/wp-content\/uploads\/2021\/08\/Social-login_15.jpg\" alt=\"Example of social login buttons at the website registration form.\" class=\"wp-image-18777\" srcset=\"https:\/\/hivepress.io\/wp-content\/uploads\/2021\/08\/Social-login_15.jpg 750w, https:\/\/hivepress.io\/wp-content\/uploads\/2021\/08\/Social-login_15-267x300.jpg 267w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\n\n\n\n<p>If you have any trouble adding the social login buttons, please try disabling third-party plugins <em>(there may be a caching issue or a conflict with third-party plugins)<\/em>. Also, please make sure that you enabled the authentication methods in the <strong>WP Dashboard &gt; HivePress &gt; Settings &gt; Users <\/strong>section and save changes.<\/p>\n\n\n\n<p>Additionally, if you want to optimize your website, we recommend checking our tutorial on how to <a href=\"https:\/\/hivepress.io\/blog\/speed-up-a-directory-or-marketplace-website\/\" target=\"_blank\" rel=\"noreferrer noopener\">speed up a HivePress-built website<\/a>.<\/p>\n\n\n\n<p>You may also want to check some of our other articles:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/hivepress.io\/blog\/best-wordpress-directory-plugins\/\" target=\"_blank\" rel=\"noreferrer noopener\">List <\/a>of the best WordPress directory plugins;<\/li>\n\n\n\n<li><a href=\"https:\/\/hivepress.io\/blog\/best-free-wordpress-directory-themes\/\" target=\"_blank\" rel=\"noreferrer noopener\">List <\/a>of the most popular free WordPress directory themes.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>A quick guide on adding Google &#038; Facebook login buttons to HivePress-built websites.<\/p>\n","protected":false},"author":686,"featured_media":18801,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[9],"tags":[],"class_list":["post-18751","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials"],"acf":[],"_links":{"self":[{"href":"https:\/\/hivepress.io\/api\/wp\/v2\/posts\/18751","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hivepress.io\/api\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hivepress.io\/api\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hivepress.io\/api\/wp\/v2\/users\/686"}],"replies":[{"embeddable":true,"href":"https:\/\/hivepress.io\/api\/wp\/v2\/comments?post=18751"}],"version-history":[{"count":10,"href":"https:\/\/hivepress.io\/api\/wp\/v2\/posts\/18751\/revisions"}],"predecessor-version":[{"id":32800,"href":"https:\/\/hivepress.io\/api\/wp\/v2\/posts\/18751\/revisions\/32800"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/hivepress.io\/api\/wp\/v2\/media\/18801"}],"wp:attachment":[{"href":"https:\/\/hivepress.io\/api\/wp\/v2\/media?parent=18751"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hivepress.io\/api\/wp\/v2\/categories?post=18751"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hivepress.io\/api\/wp\/v2\/tags?post=18751"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}