Add Facebook Comment box in your website

You can include facebook comment box in your website. So that the users can comment on your post directly to facebook.

Inorder to use this plugin in your website you should first create an application in facebook app page, so that facebook will link your website with that application using an application id. Inorder to create an application click here.

After creating the app, you will get an application id.

Then use the following script to include the comment box in your website.

1. <html xmlns:fb=””>

Include the above code in the html tag of your site.



<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); = id;
js.src = “//”;
fjs.parentNode.insertBefore(js, fjs);
}(document, ‘script’, ‘facebook-jssdk’));</script>

Include the above code in the body section of your page. NB. Replace the XXXX portion with your application id.

3. <fb:comments href=”” num_posts=”2″ width=”470″></fb:comments>

Place the above code in the place where you wish to add a comment box. Replace the “” with your page url.

You can adjust the width of the box and also the number of comments to be displayed.

Leave a Comment