The Web Blinders logo

Programming

How to use Facebook Comments Plugin on your website step by step explained

Facebook has over 2.38 billion active* users and by including Facebook comments plugin, you can take advantage of facebook user base and rich features of facebook commenting

STEP 1 - FILL FACEBOOK COMMENTS PLUGIN CODE GENERATOR FORM

Go to https://developers.facebook.com/docs/plugins/comments/ and fill Comments Plugin Code Generator form.

Facebook Comments Plugin Code Generator
Facebook Comments Plugin Code Generator

Fill URL to comment on with your url, keep Width as 100% if you want it to be responsive and Number of posts indicates number of comments to be loaded on your website load.

STEP 2 : ENTER BASIC APP SETTINGS

After clicking on Get code , following pop up shows up saying the app is still in development mode.

Facebook Comments Plugin Copy Code
Facebook Comments Plugin Copy Code

To make app publicly available, open the link App Dashboard shown in the above image in new tab and you will find settings in the left pan,go to Basic Settings

Facebook Comments Plugin - Basic Settings
Facebook Comments Plugin - Basic Settings

Privacy Policy Url and Terms of Service Url are mandatory. After filling click on Save Changes

Toggle off as shown in the above image. A popup shows up which asks for confirmation,click on Confirm

STEP 3 : ADDING PLUGIN CODE TO YOUR PAGE.


<meta property="fb:app_id" content="YOUR-APP-ID"> 

Place above code between head tags.

Now to go step 1: copy that code into your page and also load Facebook JavaScript SDK as shown below.



<html>
<head>
    <!--COPY BELOW META TAG-->
    <meta property="fb:app_id" content="YOUR-APP-ID">
</head>

<body>

    <!-- COPY START -->
    <div id="fb-root"></div>
    <!--COMMENTS WILL LOAD IN THIS DIV -->
    <div class="fb-comments" data-href="YOUR_URL" data-width="100%" data-numposts="5"></div>
    <script>
        window.fbAsyncInit = function () {
            FB.init({
                appId: 'YOUR-APP-ID',
                autoLogAppEvents: true,
                xfbml: true,
                version: 'v3.2'
            });
        };
    </script>
    <script async defer src="https://connect.facebook.net/en_US/sdk.js"></script>
    <!-- COPY END -->
</body>
</html>

That's it , now if you load your page , you can see the comments plugin working.

FINAL STEP : HOW TO GET NOTIFICATIONS FOR NEW COMMENTS-FACEBOOK COMMENTS PLUGIN

Go to https://developers.facebook.com/tools/comments/ , in Settings you will see Moderators ,add your profile there for getting notifications.

Facebook Comments Plugin - Moderators
Facebook Comments Plugin - Adding Moderators

You can view and perform actions on comments received for your website/post on this url - https://developers.facebook.com/tools/comments?id=YOUR_APP_ID

Need developers ?

if so, send a message.

thewebblinders@gmail.com

More Programming from our blog

SEARCH FOR ARTICLES