Facebook Comments Plugin And The Domain Problem

Facebook Comments Plugin ExampleWhile working to move this site to using encryption, I have come across another painful reminder of how inadequate the Facebook comments plugin really is. When changing the url (and ultimately the domain) of this site from to Facebook doesn’t handle the change very well. What I’m left with is losing another swath of great comments and thinking of a fix.

After this change, you’ll notice that posts on this site have lost all comments. Hundreds of wonderful thoughts that help you (and I) learn more about what others think of posts are sitting on Facebook, but they now don’t show on my blog. I also saw this when I changed from to – though there weren’t as many comments back then.

One way around this appears to be changing the “data-href” tag attached to the post back to the old tag. An example of this change for me might look like:

<div class=”fb-comments” data-href=””>

<div class=”fb-comments” data-href=””>

This, however, appears difficult to do programmatically inside of WordPress – not exactly ideal going forward (using an incorrect URL could cause other issues). I imagine the use of home_url( ‘/’ ) in WordPress isn’t going to cut it, so I’d have to split the URL into the domain (I set that to and then add the slug. This may include the use of $_SERVER[‘PATH_INFO’] out of PHP to strip the details. It doesn’t seem like WordPress exposes that, though a little more research may yield an answer.

Another idea is to use two (or as many as you need) “data-href” tags in a post. I want to test that out and see how it works. I’m fairly confident that it will either mess up Facebook Comments or simply not display anything at all. I’ve found the system to be less-than-robust in the past.

Don’t get me wrong, I like Facebook Comments for the most part. It’s not too difficult to integrate, and it generally forces everyone to have an account, which I think is useful in a commenting context. I also like how the plugin has a relatively minimalist look to it. The system, even with all its problems, has a great deal of potential if Facebook would just improve it.

Facebook, if you want to continue offering this feature, please update it to allow me the chance to import comments to my new URL. If you don’t want to offer an import tool, let me at least claim all of my comments by way of a stacked “data-href” tag. Really, you can pick the best way to implement this (and I’ll use it). If you offer this, I can maintain the continuity of comments on the site and not lose what makes interactions valuable.