Facebook comments gone after site migration

Just wondering how to go about getting the old comments back. Any links to resources would be appreciated. The app seems to be set correctly, but it’s not showing the old comments.

site:

Hi @jrhager84,

Did you change the URL of your site or set it from http to https? If so, Facebook comments reset to zero since comments and rendered in URL bases.

Please try the suggestion here to recover the comments:

https://developers.facebook.com/docs/plugins/faqs#faq_1149655968420144

Hope this helps.

Where do I put this code in? It seems silly that changing to https would break everything, no?

Hi @jrhager84,

You can add something like this on your child theme’s functions.php file

add_action('wp_head','my_old_url', 1);
function my_old_url () { ?>
<meta property="og:url" content="https://example.com/old-url" />
<?php }

Replace the https://example.com/old-url with your actual old URL.

How To Setup Child Themes

Please make sure that your Facebook Comments extension is up to date (v2.0.3).

Also, please review this article and make sure all the settings on the Facebook Comments extension and Facebook App are configured correctly.

Thanks,

Maybe I did something wrong, but it didn’t seem to work. Will this only change the parent url?

If it’s a blog, will it just prefix, or would I have to supply each and every link?

Hey @jrhager84,

We’re sorry if we have given you false hopes here. The Facebook documentation provided by Jade, says that you can’t move comments.

The code suggestions are for the likes and shares.

Just for clarification, our Facebook Comments extension only is an interface for Facebook’s Comment feature. There is nothing we could do if Facebook resets the comments as data is stored in their server.

Thanks for understanding.

But it’s exactly the same url, except https instead of http.

Hello @jrhager84,

Did you use an SSL plugin to force the SSL in your site? Please install Better Search and Replace plugin. You will need to do as search for http://example.com and replace it with https://example.com

Please let us know how it goes.

Well, it’s forced SSL now, meaning all of the previous links are http links. By my estimation, the links saved in FB’s database are http so a search and replace on my site won’t change the fact that’s it’s loading at https, no?

Here’s the code that fixed it:

(In functions.php of child theme):

function rsssl_exclude_http_url($html) {
//replace the https url back to http
$html = str_replace('data-href="https://www.yourdomain.com', 'data-href="http://www.yourdomain.com', $html); return $html;
}
add_filter("rsssl_fixer_output","rsssl_exclude_http_url");

Hey @jrhager84,

We are just glad that you have figured it out a way to correct the said issue.
Thank you very much for letting us know and sharing your resolution!

Cheers.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.