Explicit ‘href’ Problem With Facebook Comments

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:

<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=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?

Comments

  1. says

    I am not able to help further sorry with all you have tried being fairly exhaustive, but if you do find a solution or work around for this, please post back as I think this is going to be affecting a lot of people. Good luck for all our sakes.

    I will continue to look at things my end.

  2. says

    Oh boy, looking for a solution ourselves. We do love changing our code every month to keep up with the changes. Yet, most of the time they do end up smoothing out.

    • says

      Thanks for that Brett. I’ve subscribed to the bug and added my own info as well.

      Not only should it degrade gracefully, but the fact that ordinary users and not just admins can see the error is frankly disgraceful.

  3. James Dyson says

    Paul – We have exactly the same problem with our wordpress theme – I’ve been trying everything but can’t find a solution.

    I’d be interested in hearing if you do work anything out!

    • says

      Thanks for that Casper, but the author of that solution for Blogger jumped the gun and it doesn’t work. They’ve updated their post to reflect that.

      Their post was been copied far and wide around the web it appears with nobody actually testing it.

      Thanks anyway, will keep trying :)

    • says

      It hasn’t fixed itself on any of the 5 sites we have which use Facebook comments. For those who may not realize, the error doesn’t appear once somebody leaves a comment. It only appears if there are no comments.

  4. ZAP says

    There’s still no fix for this, is there? The warning is annoying, but it’s better than losing all our comment history. The new comment script also seems to cause a major issue when people click to reply to a comment in Facebook and your website is still using the old comment script (instead of showing the relevant comment on your page, no comments load at all).

    • says

      Paul, have you tried this solution on a site with actual comments? There are a number of solutions that fix the error, but as far as I know all of them are at the expense of losing the existing comments.

      Also, at this point I would suspect most people have either bitten then bullet and switched, or simply dumped FB comments. I would think a complicated work around may be something that is liable to need constant updating.

      Thanks for sharing, and please, let me know if you’ve tested the solution on a site with actual comments as some of my readers may still have use for this.

  5. Ivan says

    Am tempted to switch to a new plugin that uses the new code for my site. But not sure if I want to lose all my previous comments.

  6. says

    Ed, I am having trouble with your facebook developers link. As far as the snippet of code you have there, where in the plugin do you place it?
    TIA

  7. says

    this is so retarded. anybody know how to just get rid of the yellow box with the “error” text in it? Can’t we edit the plugin just to hide that. I will be having some serious people look at my website and I can’t have stupid errors on it. I’m changing it to v2 only and getting rid of it for now.

    This makes my site look like nobody has left a comment, but what can I do.

  8. Mohammed says

    what about creating new website (based on nopcommerce) so, no need for older posts or any stuff like that and the warning yellow box still appear !!
    I tried every solution on the web but nothing changed :( . Facebook doesn’t really help.

  9. says

    I’m still seeing this problem on several comment boxes and it’s already 2014. I’ve given up on my FB app and just moved to WordPress. Using plugins is a whole lot easier and leaves taking care of the problems to the developer.

Leave a Reply