7EC330B5-B132-499A-A307-65040D76AA48 How to embed and manage Facebook comments on WordPress

How to embed and manage Facebook comments on WordPress

To be able to embed and manage Facebook comments on your WordPress site, you can use plugin or edit your WordPress code.

 

I. EMBED FACEBOOK COMMENTS USING PLUGIN

To be able to embed WordPress Comment Facebook, you need to download the Facebook Comments plugin at the address: https://wordpress.org/plugins/facebook-comments-plugin/ and install it.

Or, you can log into WordPress admin page, choose Plugins » click Add New (item 1) to go to the Add Plugins page. In the Search Plugins textbox (item 2), you enter the keyword “facebook comments” and press Enter to start searching Facebook Comments Plugin » Click on the Install Now button to install this plugin.

Click on the Activate Plugin button to activate this plugin after successful registration.

Continue selecting Settings » Facebook Comments (item 1). You need to enterFacebook App ID (item 2) to show Facebook comments on your WordPress site and enter Facebook User ID in the Moderators textbox to manage comments on your Facebook account.

 

I.1. Create a Facebook app

To get a Facebook App ID, you need to create a Facebook app » See more at: How to create a Facebook App for your website . In this example, I created an app is “firstappdemo” with App ID is 1607132996198694

I.2. Get your Facebook User ID

You need to use your Facebook User ID to manage Facebook comments » See more at:Instructions on how to get your Facebook Page ID and Facebook User ID .From this guide, I find my Facebook User ID is 100006844891xxx

I.3. Configure the Facebook Comments Plugin

In the configuration page of the Facebook Comments plugin, we will enter the Facebook App ID in the APP ID item (item 2) and the Facebook User ID in theModerators item (item 3).

Click on the Save Changes button.

Note: You can add multiple moderators by entering each Facebook Profile ID separated by a comma. And this is the result:

II. EMBED FACEBOOK COMMENTS MANUALLY

II.1. GET A FACEBOOK APP ID AND FACEBOOK USER ID

If you don’t want to embed Facebook comments by using the Facebook Comments Plugin, you can embed Facebook comments manually.

First, you need to create a Facebook app and get the App ID. Then, get your Facebook User ID. In the Part I.1 and Part I.2, I created an app that has App ID=“1607132996198694”and Facebook User ID = “100006844891xxx”.

II.2. PASTE THE CODE INTO THE FILE INDEX.PHP

You choose Appearance » Editor (item 1). Click on the file Header (header.php – item 2). In the <meta> area, you insert the following code (item 3):

<meta property="fb:app_id" content="1607132996198694" />  /*1607132996198694 is your Facebook App ID */
<meta property="fb:admins" content="100006844891xxx"/> /*100006844891xxx is your Facebook User ID*/


Enter Update to save changes.

II.3. GET THE EMBED CODE FROM FACEBOOK

You go to the address: https://developers.facebook.com/docs/plugins/comments

Click on the Get Code button to get the embed code.

You need to add a line of code to the code above to show the Facebook comments on your WordPress site. So, the embed code you need to copy is:

<div id="fb-root"></div> <script>(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.3&appId=1607132996198694"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));</script>

<div class="fb-comments" data-href="/<?php the_permalink(); ?>" data-numposts="10" ></div>

In the WordPress admin page, you choose Appearance » Editor. Click on the file Single Post (single.php) to open it and paste the code into the position as shown below (item 1):

Note: With other themes, the template show single post isn’t in the file Single Post (single.php). It may be the file Content (content.php) or another file. It depends on the theme you are using. In this example, I’m using the theme Hueman.

In the file single.php of this theme, the line of code in the item 2 will show related posts and the line of code in the item 3 will display comments on your WordPress site. You can delete these lines if you don’t want to show them.

You will see the Facebook Comments box in all posts:

III. MANAGE FACEBOOK COMMENTS ON FACEBOOK

To manage Facebook comments on Facebook, you need to go to the address: https://developers.facebook.com/tools/comments

You click on the Hide button to hide a comment. Click Approve to approve a comment. Click on a post link behind the text “Commented on “ to go to the post and reply that comment using your Facebook account.


Choose a language

You are here

SEARCH

CMMS Lazada

Subscribe YouTube

 

Hải sản Vân Đồn

Chào mừng bạn đến với chuyên mục giới thiệu và cung cấp các mặt hàng hải sản của Vân Đồn. Hải sản Vân Đồn - Quảng Ninh | Tươi ngon, bổ dưỡng và đảm bảo với giá cả phải chăng. Xem trang....

UDEMY COURSES

Sitewide2of4-Oct-15dollars300x250