Explicit ‘href’ Problem With Facebook Comments

Time to read:

2 minutes

On all of our sites which are using Facebook comments we’re currently getting the following warning:

Warning: this comments plugin is operating in compatibility mode, but has no posts yet. Consider specifying an explicit ‘href’ as suggested in the comments plugin documentation to take advantage of all plugin features.

Facebook has (again) changed the code for displaying Facebook comments and wants it to look like this:

After the <body> tag:

<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=OURAPID";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));

Where you want your comments to appear HTML5 OR XFBML:

HTML5:

<div data-href="http://geekisawesome.com/2309/super-mario-earrings/"
data-num-posts="20" data-width="610"></div>

XFBML:

<fb:comments href="http://geekisawesome.com/2309/super-mario-earrings/"
num_posts="20" width="610"></fb:comments>

This is what we are currently using where the comments appear (XFBML):

url="http://geekisawesome.com/2309/super-mario-earrings/" numposts="60"
width="610" publish_feed="true" migrated="1">

If we move to the newer code it becomes:

<fb:comments href="http://geekisawesome.com/2309/super-mario-earrings/"
num_posts="20" width="610"></fb:comments>

It’s fairly obvious that FB is moving away from having the XID as the post identifier in favor of “href” but if we move to the new code then all of our comments disappear.

I’ve tried replacing the “url” with “href” in the old code, and passing “href” alongside “url” in the old code to no avail. It did result in the warning disappearing but at the expense of all the comments disappearing as well.

I’ve also tried passing the XID to the new code, XID with the post ID, adding the XID with “migrate=’1′” and numerous variations there of.

It appears to me that the only way to make the warning disappear is to switch over to the newer code which uses “href” instead of “url” and lose our comments in the process.

Obviously we don’t want to the lose the thousands of comments we’ve built up since switching to FB comments and we don’t want to move away from FB comments as they’ve provided a massive increase in interactivity on our sites, but this is an annoying problem.

Has anybody else come across or developed a solution for this yet? Am I missing something glaringly obvious?