[Facebook Comments Box] Add Facebook Comments Box Social Plugin Widget on your website in 2 Steps

Tags:

I started getting following XID error message in my Facebook Comments Box Social Plugin which I had integrated on one of my website some time back.

“The comments plugin requires an application id to properly namespace the provided xid.”

Reason for this error is that Facebook has again updated its Social Plugins and although I have already posted on this, the procedure for integrating Comments Box Social Plugin in your website has changed now.

Comments Box is a social plugin that enables user commenting on your site. Features include moderation tools and distribution.

Here’s the new process to add Facebook Comments Box on your website in two easy steps.

Step 1

Go to http://developers.facebook.com/docs/reference/plugins/comments/ and provide the URL to comment on, you need to provide your website domain name here or in case your web page is a static one, please provide full url to the article page.

Also provide Number of posts to display by default

Also provide Width, and hit the Get Code button.

Copy the generated code which should be soemthing like this:

 
<div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#appId=xxxxxxxxxxxx&amp;xfbml=1"></script><fb:comments href="http://www.website.com/" num_posts="2" width="600"></fb:comments>

Step 2

Just go ahead and place the code inside your website. If you have a bigger dynamic website, you can easily generate your existing article page link dynamically using the url of the web page in php or any other server-side language. For a php website, you can use following code snippet:

 
<div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#appId=xxxxxxxxxxxx&amp;xfbml=1"></script><fb:comments href="http://www.website.com/<?=$_SERVER['REQUEST_URI']?>" num_posts="2" width="600"></fb:comments>

Now place this code inside your website where you want the comments widget to appear. Make sure you place this snippet in a php page and not an html.

That’s it.

Adding Administrator(s) for Comments Moderation

Admins can choose to make the default for new comments entered either “visible to everyone” or “has limited visibility” on the site (i.e., the comment is only visible to the commenter and their friends), to help mitigate irrelevant content.

Admins can also blacklist words and ban users. If a new comment is published from a banned user or contains a blacklisted word, this comment will automatically have limited visibility.

To moderate, you need to list yourself as an admin. To do this, simply include open graph meta tags on the URL specified as the href parameter of the plugin. Include:

 
<meta property="fb:admins" content="{YOUR_FACEBOOK_USER_ID}"/>

If your site has many comments boxes, you should specify a Facebook app id as the administrator (all administrators of the app will be able to moderate comments). Doing this enables a moderator interface on Facebook where comments from all plugins administered by your app id can be easily moderated together.

 
<meta property="fb:app_id" content="{YOUR_APPLICATION_ID}">

Hope that Helps.

Cheers!

Related posts:

  1. How to add Facebook Comments Box widget on your website in 3 steps
  2. How to add Facebook Like Box widget on your website in 2 steps
  3. [Facebook] Resolve Thumbnail Image Preview Issue while Sharing Article on Facebook
  4. Automatic Subscription for New Topic or Posting Comment to Get Email Notifications in Mingle Forum WordPress Plugin
  5. Text Slider for Testimonials with Navigation – JavaScript Widget using jQuery Cycle Plugin