0

I have a weird problem. Two weeks ago I migrated my Wordpress sites from http to https. I used the Really Simple SSl plugin to get it all secure: https://wordpress.org/plugins/really-simple-ssl/ That worked great. But after the migration I saw I lost all my FB like counts.

I found the solution I thought in this article: https://really-simple-ssl.com/knowledge-base/how-to-recover-facebook-likes-after-moving-to-httpsssl/ It is from the same author as the Really Simple SSL plugin. I put the code in the functions.php from my theme. But soon I found out, that on some posts the counts were restored, but on other postst the counts are zero: https://www.tina-turner.nl/blog/page/11/

I have 3 websites and on 1 of them it works alright. But on the other 2 sites I have the problem. I started with deactivating all plugins and also changed the theme, but that didn't solve the problem. I searched the internet, but can't find a solution for this problem.

The one thing I didn't try yet is to buy the Really Simple Social plugin from this same author. He says maybe when I activate the og: url in that plugin it might work. https://really-simple-ssl.com/downloads/really-simple-ssl-social/

But first I am trying to achieve this without buying anything. I tried some code. The original code in the functions.php is this:

// Recover FB Counts
function rsssl_exclude_http_url($html) { //replace the https url back to http $html = str_replace('data-href="https://www.tina-turner.nl/blog', 'data-href="http://www.tina-turner.nl/blog', $html); return $html; } add_filter("rsssl_fixer_output","rsssl_exclude_http_url");

I tried to add some code for the og: url, but I am not good with code. This is what I tried and that didn't work:

// Recover FB Counts
function rsssl_exclude_http_url($html) { $html = preg_replace('~<meta property="og:url" content="https://~', '<meta property="og:url" content="http://', $html, 1); $html = str_replace('data-href="https://www.tina-turner.nl/blog', 'data-href="http://www.tina-turner.nl/blog', $html); return $html; } add_filter("rsssl_fixer_output","rsssl_exclude_http_url");

That filter is necessary, since the Really Simple SSl plugin sets everything from http to https.

Oh and to be complete, I use the Add to Any plugin for the FB Like button.

Can somebody help me with this?

Johanna

  • Probably just a caching issue. Send one of those URLs through the debug tool to refresh the cache, and see if that fixes the issue. https://developers.facebook.com/tools/debug/ – CBroe Mar 22 '17 at 13:10
  • Ok I just did that and got this: This URL hasn't been shared on Facebook before And I got 6 warnings: – Johanna Ouwerling Mar 22 '17 at 13:48
  • The 'og:url' property should be explicitly provided, The 'og:title' property should be explicitly provided The 'og:description' property should be explicitly provided The 'og:image' property should be explicitly provided The 'fb:app_id' property should be explicitly provided, Specify the app ID so that stories shared to Facebook will be properly attributed to the app. Alternatively, app_id can be set in url when open the share dialog. The 'og:image' property should be explicitly provided, even if a value can be inferred from other tags. – Johanna Ouwerling Mar 22 '17 at 13:48
  • For example for https://www.tina-turner.nl/blog/adrienne-warren-with-tina-turner-poster/ the `og:url` meta tag still points to the HTTPS version. – CBroe Mar 22 '17 at 13:53
  • I managed to get rid of those warnings by filling in the necessary info in the Yoast SEO plugin. The only warning I get now is: Image Unavailable Provided og:image, https://.....jpg could not be downloaded because it exceeded the maximum allowed sized of 8Mb or your server was too slow to respond. But that can't be. Maxcdn isn't slow and the image is only 34 kb. – Johanna Ouwerling Mar 22 '17 at 14:02
  • But how can I get that og: url to point to the http version then? Because that is the point of course I think to get those likes back. – Johanna Ouwerling Mar 22 '17 at 14:03
  • I thought the code you have shown was supposed to achieve exactly that already? – CBroe Mar 22 '17 at 14:04
  • When you put the mentioned image URL into the debug tool directly, you get “Can't Download - Could not retrieve data from URL.” - so you will have to check if that CDN is somehow configured to block requests by “bots” or something like that. – CBroe Mar 22 '17 at 14:05
  • The code in my first post doesn't work. I am searching for the right og: url code. – Johanna Ouwerling Mar 22 '17 at 14:05
  • I will ask Maxcdn, but I doubt that has to do with showing the FB Like counts. – Johanna Ouwerling Mar 22 '17 at 14:07
  • No, that last one was regarding your issue with the og:image ... – CBroe Mar 22 '17 at 14:07
  • Ok the image is there, but the FB like counts are still not, so I am still searching for the right og: url code. – Johanna Ouwerling Mar 22 '17 at 14:14

0 Answers0