Hi,
we just migrated our site to HTTPS using a Comodo SSL certificate. To help with this we installed the Real Simple SSL WordPress plugin. Everything is fine, but we lost all Facebook counts.
What can we do in order to fix this? We are using a child theme.
A fast response will be greatly appreciated!
Thank you in advance for your time!
The developers of the Real Simple SSL plugin recommend using this code within the functions.php:
function rsssl_exclude_http_url($html) {
//replace the https url back to http
$html = str_replace(‘data-href=”https://www.domain.com’, ‘data-href=”http://www.domain.com’, $html); return $html;
}
add_filter(“rsssl_fixer_output”,”rsssl_exclude_http_url”);
I added it to the functions.php of our child theme, but it isn’t working.
Theme doesn’t manage SSL or Facebook counts, technically.
So, when you change your URL, it’s no longer the same URL, as treated by FB. There are some hacks out there, which generally need to be done in the main functions.php file.
Also, you need to ensure
a) you have set the https url explicitly in your wp-config.php file
b) done a search/replace for http/your site to https/your site in yout MySQL dbase
c) setup a redirect in your htacess file for all http requests to > https
Whatever hack you use aside from the above “required” stuff for moving to https, be aware it may not always work as you are tricking FB into seeing the old link as the new link, when technically it’s not the same URL.
Much like adding the new site to your Google search console, they stupidly consider it a new site, and does not replace the original in your search console; also note inbound links will show different, and your indexing may change for up to 3 months with the shift.
It’s very much worth doing and should be considered required to be https these days, but you have run into just one of the many issues in the ‘move.’
Try putting the function into the *main* theme functions file. This is one of the many reasons I never use child themes; makes this kind of thing notably trickier as the child theme is essentially a CSS redirect to over-ride the main theme.
Thanks for the detailed response.
When I put the code at the end of the *main* functions.php file, the site becomes unavailable.
The theme Newspaper is using the plugin tagDiv social counter. I guess the developers could help with hacking it somehow in order to bring the counts back.
We definitely need a solution! We are speaking about tens of thousands of Facebook likes, so we can’t leave things as they are, and unfortunately can’t switch back to http. Also we plan to open a shop, so https is a must for us.
Looking forward to hearing from the developers with a solutions.
This is the nature of moving to https — all your URLs are now different URLs.
The TagDiv plugin only connects to your FB account/app to “get the info” — so, the new pages with NEW URL have no shares, so that is what is shown.
You will need to Google various solutions for this issue, search forum for past issues and possible solutions.
Theme devs can’t create hack for you, as not theme related. This is how FB works — each URL is unique.
Yes, https is more important than tracking who liked your pages – nobody except you really cares about that. The average user does not care, which is why we removed that element from all our news portals in 2014.
So, likely good to go scouting Google for solutions on how to address this, the FB support forum, etc.
Perhaps a kind soul who already dealt with this will chime in as I’ve done — we chose to just abandon the likes count, as not relevant to the ‘actual’ content we create. We prefer ‘shares’ over ‘likes.’
Anyway — food for thought (I don’t work here.)
Theme devs can’t fix it, as nothing to fix. Plugin is doing what it is designed to do; it’s just the data has changed. So, it can’t count a URL that doesn’t exist.
I think some people hacked it to feed the non https to the counter, vs the http — but you will need to look up that hack if still mentioned in forum. Sorry.
Hi Chris,
thanks for your collaboration. Unfortunately I’m not a developer and can’t start trying different solutions myself. I purchased the Newspaper theme because it is a really good theme, easy to use and I didn’t need 3rd party developers help to set it up. I still rely on the theme’s developers team to help me solve this issue. They have been very responsive so far, so I trust they will help with this issue too.
Hello,
Sorry but Chris is right. There is no way of getting the likes back as the URL is different. This is like migrating a number of likes from one url to a completely different URL .Facebook has no way of knowing it’s the same site. If a letter in the url is changed, for Facebook it’s a completely different site and you cannot move likes from one site to another.
Sorry but the theme has no influence over this. There is no code I can provide to make facebook get the likes back.
Thank you!
I was hoping to get a hack to achieve this from you guys…
This is really important and discussed a lot during the last year. You are using your own tagDiv social counter plugin together with the theme, so I was hoping to receive support from you…
Do you really mean there’s no hack for this?
you could modify the theme so that when on a post you call the FB counter function, you call it passing the http url and not the https url. you could also put a time filter so that you will call the http version for the date prior to switching to https and the https version for the post published after the date of switching to https.
I found something that could be a solution, but don’t know how to implement it correctly and where (I’m using a child theme and redirecting via .htaccess):
https://developers.facebook.com/docs/sharing/webmasters/crawler#updating section: Migrating Content/Updating URLs
As we have mostly Facebook likes, this is what we are looking to recover.
Any ideas?
Hi nairolf,
thanks for the suggestion, but this isn’t a solution for us because we have facebook like button with counter. We use the tagDiv social counter plugin (provided by the tagDiv team) together with the Newspaper theme, and the style totally differs from the buttons in the plugin you are suggesting. tagDiv use the standard Facebook like button and we’d like to keep the design unchanged.
I really hope that the plugin developers will come out with a solution.
Thanks again for the collaboration!
Hey guys,
I’ve found a solution, not the best but it helped me solve this.
Here is my fix:
I have YoastSeo plugin and it solved my issues.
1. Go to each post and edit it.
2. In the Yoast screen, click the gear icon and in the canonical field, insert your old http url.
3.Update and scrape again using the fb debugger tool.
4.Click on scrape again 2 times.
5. Social signals are back.
I hope it helps.
