Switching from HTTP to HTTPS, lost all Facebook “Likes” count
Asked Answered
S

5

19

I switch from http to https two months ago, and now lost all my 'Likes'.

Even when I use facebook debug tool it now has the same count between the http:// and https://

Anyone knows whether it is a facebook bug? or is there a workaround solution to retrieve my old 'Like' count?

Sibley answered 3/12, 2014 at 0:47 Comment(0)
R
13

Typically Facebook likes are linked to a URL. Even a single character change will lose Facebook likes.

Here is a link on Facebook

https://developers.facebook.com/docs/plugins/faqs#moving-urls

Go to the bottom of the page and find this section How do I move a page to a different URL? - can I migrate the number of likes to the new page location?

<meta property="og:url" content="https://example.com/old-url" />

You will need to instruct the facebook crawler to re-scrape your url for the changes to take effect:

https://developers.facebook.com/tools/debug/sharing

That should be a solution to your problem.

Ragen answered 3/12, 2014 at 0:57 Comment(3)
After that, you should put likes on the most important pages of your web site. After refreshing those pages, you will see immediately all your previous Facebook likes.Rinderpest
Weird, I have that (and the Open Graph debugger shows that the http canonical URL is recognised correctly, with its correct number of likes) but still, the Like button on the page shows the (much smaller) likes for the https page.Anabel
I solved the problem above by making sure the data-href attribute of my fb-like button used the https URL (it was still using the http URL).Anabel
N
8

The steps that should be followed in order not to lose Facebook likes when migrating HTTP to HTTPS are:

1. Use 301 Redirect on web page for HTTP to HTTPS.

2. Add og:url tag on the HEAD section for http://www.example.com

<meta property="og:url" content="http://www.example.com" />

3. Modify Facebook code to count HTTPS likes on page:

<iframe src="//www.facebook.com/plugins/like.php?href=https%3A%2F%2Fwww.example.com&amp;width&amp;layout=box_count&amp;action=like&amp;show_faces=false&amp;share=true&amp;height=65" scrolling="no" frameborder="0" allowTransparency="true"></iframe>

or

<div class="fb-like" data-href="https://www.example.com" data-layout="standard" 
      data-action="like" data-show-faces="true"</div>

4. Go to Sharing Debugger on Facebook website.
You must be log on Facebook in order to use it.

Enter https://www.example.com and press Debug button.

enter image description here

5. If no other likes are on the HTTPS version of the page, the following info appears:

**enter image description here**

Press Fetch new information button.

6. If by any chance there are any likes for the HTTPS version of the page or the Facebook crawler already visited your page, the following info appears:

enter image description here

Press Scrape Again button.

7. Refresh your web page and the Facebook likes should be present.

More information about how the Facebook crawler works can be found at:
https://developers.facebook.com/docs/sharing/webmasters/crawler

Niphablepsia answered 21/3, 2017 at 20:4 Comment(1)
I never go this to work. In my case I use og:url as share reference, and use my like counter for the domain name home page. This site in question is filmfix.com @Eda suggestion is the only way I can keep my Likes intact.Vowell
C
2

I use iframe-version of FB Like button code and this worked fine in my case:

  1. Redirect pages in .htaccess to HTTPS version for all, except Facebook Bot (code for Apache 2.4):

    RewriteCond %{HTTP_USER_AGENT} !^facebookexternalhit
    RewriteCond %{HTTPS} off
    RewriteRule (.*) https://%{HTTP_HOST}/$1 [R=301,QSA,L,NE]
    
  2. Use HTTP version of URL in og:url tag (this is rendered in HTTP and also HTTPS version of page):

    <meta property='og:url' content="http://my-domain.com/xyz">

  3. Use HTTPS version of URL in canonical tag (this is for "the rest of the world" except Facebook):

    <link rel="canonical" href="https://my-domain.com/xyz">

  4. Use HTTP version of URL in iframe with facebook like button:

    <iframe scrolling="no" frameborder="0" allowtransparency="true" src="https://www.facebook.com/plugins/like.php?layout=button_count&amp;show_faces=false&amp;width=200&amp;action=like&amp;colorscheme=&amp;height=21&amp;href=http%3A%2F%2Fmy-domain%2Fxyz"></iframe>

This is the way how can you preserve all likes on all pages and also have full-HTTPS traffic.

I recommend to use this trick only for "old pages". New pages could use new address with HTTPS everywhere (they don't have "old likes" on "old URL").

The benefit compared to other solutions is, that there is no need to recrawl all pages by FB Bot. Likes are preserved immediately (if you do not use HTTP URL in iframe, it also works, but you need to recrawl every page to see old likes on the new page).

Cedric answered 31/12, 2018 at 14:17 Comment(1)
This should be the correct answer. FB should really fix this. It would be so easy for them to just combine the http count with the https count into a new total count.Vowell
D
0

If you use the fb-like button with the old 'http' link it shows you all the old likes:

<div class="fb-like" data-href="http://www.example.com" data-layout="button_count" data-show-faces="false" data-send="false" data-share="true"></div>
Disclaimer answered 2/11, 2020 at 22:27 Comment(0)
B
-2

You can recover your social media shares. For G+ it's easy as you have to modify just the Google+ sharing buttons so that you will share the URL on http and not on https. when it comes to fb you need to:

  1. use the debug interface to check out your urls
  2. click on "scrape again" - all your social counts will get to zero
  3. update rel = canonical and make the http version the preferred one but just for FB crawlers
  4. identify FB crawler ; here depends on what you are using; exact code examples here: https://cognitiveseo.com/blog/13431/recover-facebook-shares-https/

Hope this helps you out!

Bern answered 24/3, 2017 at 13:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.