How to add Login with a Facebook Account option on your WordPress site (Complete Guide)
If you are addicted to surfing the internet regularly then you have already seen a system for login on a website with your Facebook account. As of the fourth quarter of 2017, Facebook had 2.2 billion monthly active users. You can add this option to your WordPress site with some simple steps. If anyone logs into your WordPress site with a Facebook account your WordPress will automatically create a user id. This feature will help you engage your audience more.
Today we will learn how to add a Login with a Facebook Account option on your WordPress site.
To do this we need to follow some steps.
- Creating a Facebook App
- Installing Facebook Login WordPress Plugin
- Connecting your FB app to your WordPress.
Creating a Facebook App.
To add Login with Facebook option firstly you need a Facebook app.
First, go to this link
Click the Create new Facebook App button.
On the Pop-up, give a name for your FB App and click the Create App ID button to go.
Enter the Captcha and Submit.
Go to Settings>>Basic option to complete your app settings.
Now Select the OFF on top to ON your app. You will be asked for confirmation that does you want to make your App public. Confirm it.
After confirming it you will see your app status as Active.
Installing the Facebook Login Plugin and Configuration.
Go to your WordPress Dashboard and Plugins>>Add New Option to add Facebook Login Plugin or Download it from official WordPress Directory and install it.
You will get a new settings page create on Settings>> Facebook Login.
Give your APP ID and Secret Code that you get on your FB APP page. And Save your Setting.
Now go to your login page. http://mysite.com/wp-login.php. Replace my site with your domain name. You will see a new option created for Login with Facebook Account on your WordPress site.
Extra: you can use a shortcode to show a login with Facebook anywhere on your site.
Go to Appearance>>Widget and add a new Custom HTML Widget on your sidebar and put the [fbl_login_button redirect=”” hide_if_logged=””] shortcode there.
If you want to add Facebook on your Template file use
<?php do_action('facebook_login_button'); ?>
code where you want the button and
<?php do_action('facebook_disconnect_button'); ?>
to disconnect user from your website.
Hope you can add a Facebook Login Button successfully after reading this article.