Home » Webtips » Add Facebook Comment box in your website

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=”http://ogp.me/ns/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); js.id = id;
js.src = “//connect.facebook.net/en_US/all.js#xfbml=1&appId=XXXXXXXXXXXXXXX”;
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=”http://example.com” num_posts=”2″ width=”470″></fb:comments>

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

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

About the author


Hi, i am Vipin, a programmer working in Dubai, UAE. I love blogging, and so started TechRounder for sharing my findings and other digital informations with others too. Please feel free to share your feedback with me in the comment section below or you can email me at vipin@techrounder.com.

Add Comment

Click here to post a comment

Your email address will not be published. Required fields are marked *

Get latest updates
in your inbox

Subscribe to TechRounder mailing list and get interesting stuff and updates to your email inbox.

Thank you for subscribing.

Something went wrong.