Wednesday, 18 September 2019

How to Install and Setup Facebook Comments in WordPress

Facebook is the largest social network in the world. That’s why some of the top WordPress blogs use Facebook comments instead of the default WordPress comments.

If you are planning to add the Facebook comment system to your WordPress site, then you are in the right place.

In this article, we will show you how to install and setup Facebook comments in WordPress. We will also explain how to display the Facebook comment count on your website.

Install and Setup Facebook Comments in WordPress

Pros and Cons of Using Facebook Comments in WordPress

Before we get started with the tutorial, let’s cover the pros and cons of using Facebook comments compared to default WordPress comments.

One of the most obvious benefits is that Facebook comments increase your website’s visibility on Facebook.

When someone leaves a comment on your site, they can check the “Also post on Facebook” option to share their comment with their Facebook friends. This has a huge potential for additional traffic to your website.

Facebook comment form

Also, spammers will stay away from your website because they won’t receive a SEO backlink by commenting on your posts.

Another benefit of using Facebook comments is that it removes the anonymity factor, so users are less likely to leave spam comments because it’s tied to their Facebook profile.

However, this can act as a major downside as well.

Some users don’t feel comfortable leaving a comment using their Facebook profile because they like the sense of being anonymous.

Another disadvantage of using Facebook comments is that they are not stored or synced to WordPress, whereas third-party commenting systems like Disqus does sync with WordPress.

If you have older posts with default WordPress comments, then those comments may appear before or after the Facebook comments.

However, it is better to remove the WordPress comment system entirely if you are using the Facebook comment system on your site. Otherwise, spammers and bots will use the WordPress comments to spam your website.

Now that you know the pros and cons, let’s take a look at how to install Facebook comments in WordPress.

Setting Up Facebook Comments in WordPress

The easiest way to add Facebook comments in WordPress is by using a WordPress plugin.

We will be using the Lazy FB Comments plugin for the sake of this tutorial. This free plugin not only adds the Facebook comment system to your site, but it also lazy loads the comments to improve page speed.

First, you need to install and activate the Lazy FB Comments plugin. You may follow our guide on how to install a WordPress plugin for detailed instructions.

Upon activation, you need to visit Settings » Lazy FB Comments to configure the plugin.

Lazy FB Comments Plugin settings page

To use Facebook comments on your website, you will have to create a Facebook app and then add the application ID to the plugin’s settings page.

If you have previously created an app for your site, then you can use that application ID here. Otherwise, you will have to create a new app by going to the Facebook for Developers page.

To get started, you need to register for a Facebook Developer account if you don’t have one. Next, you will have to click on the My Apps link, present at the top-right corner of the page.

Create Facebook App button

A dropdown menu will open up where you need to click on the Create App option. This will open a modal window where you will have to provide your email address and a name for your app.

Create a new Facebook app

Once done, you need to click on the Create App ID button. This will open a popup box and will ask you to enter some CAPTCHA letters. Simply fill in the CAPTCHA textbox and then click on the Submit button.

Facebook will now create a new app for you and then redirect you to the app dashboard. You will notice your APP ID displayed there.

Facebook APP dashboard

Next, you need to tell Facebook how you’d use the App.

Simply click on the Settings » Basic link from the left sidebar, and then click on the + Add Platform button, present at the bottom of the page.

Facebook app platform button

A new popup window would appear on the screen. You need to click on Website to select it as your platform.

Select Facebook app platform

This will add a new “Website” section in your app’s settings page where you can enter your website URL.

Add website address

After saving your settings, you can now copy the APP ID and paste it in the FB Application ID textbox of the plugin’s settings page on your WordPress site.

Once you are done, you need to scroll down and then click on the Save All Changes button to store your settings.

Moderate Facebook Comments option

Now you will see a new option to “Moderate Comments” beside the title of this plugin. We will explain how to moderate Facebook comments in the next section.

This plugin also comes with a comprehensive set of options. You can go through the settings to see if there is something that you would like to change.

For example, you can change the Load Comments option to “On Scroll”. This will load the Facebook comment system only when someone reaches the end of the article. This will help you improve page load speed.

Lazy FB comments load on scroll

Other than that, the default settings should work for most websites.

Now, you can visit any post on your WordPress site to see the Facebook comment system in action.

Facebook comment system in action

Moderating the Facebook Comments on Your Website

As the admin of the Facebook app, you will get notifications for new comments when you log in to your Facebook account.

You will also find a link to moderate comments on the plugin’s settings page.

Facebook comment moderation tool

Just like WordPress comments, you can set comment moderation rules on Facebook by clicking on the Settings link. This will open a popup where you need to click on the “Moderation Rules” tab.

FB Comments moderation rules

From here, you can decide the maximum character limit to be allowed in a comment. You can also set a limit after which the comments will be automatically closed on your posts.

Facebook allows you to add new comment moderators as well. You need to click on the “Moderators” tab and then add the person using the textbox.

Adding Comment Moderators

Once you are done, you need to click on the Save button to store the settings.

Display the Facebook Comment Count in WordPress

One of the downsides of using the Lazy FB Comments plugin is that it overtakes WordPress comment count functions and outputs a Facebook-branded version of the comment count.

If your theme displays comment count, then this would not look good

If you still want to display the Facebook comment count, then you can do that with the help of a code snippet.

First, you need to connect to your WordPress hosting account using an FTP client and then go to the /wp-content/themes/ folder. 

From here you need to open your current theme folder and then locate the single.php file.

Download single.php file using FTP

Next, you need to right-click on that file and then click on Download.

After that, you should open the single.php file using a plain text editor like Notepad. Once the file is open, look for the code used by your theme to display comment count and carefully replace it with the following code.

<fb:comments-count href="<?php echo get_permalink($post->ID); ?>"></fb:comments-count> Comments

This code snippet will help you to display the Facebook comment count on every post.

Finally, you need to save the file and then upload it back to the current theme folder using FTP.

That’s all! We hope this article helped you install and set up Facebook comments on your WordPress site.

You may also want to check out our guide on how to add Facebook open graph meta data in WordPress or how to get a virtual phone number for your website.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Install and Setup Facebook Comments in WordPress appeared first on WPBeginner.



from WPBeginner https://ift.tt/306kRZB
More links is https://mwktutor.com

No comments:

Post a Comment