Search code examples
wordpressfacebookfacebook-graph-apifacebook-sharer

Facebook comments and shares reset for the old blog posts


Recently I noticed that blog posts that had almost 20k shares and 35k comments in January now have 0 shares and 0 comments. The post URI stayed permanent all this time. What could be the reason for that and, more important, how to get shares/comments back?

Here's the link that shares a post of Facebook

<a href="https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fwww.grammarly.com%2Fblog%2F2015%2Fwhat-is-the-oxford-comma-and-why-do-people-care-so-much-about-it%2F" target="_blank" class="fb-share">

Below is the request to receive the number of shares

type: 'GET',
url: 'https://graph.facebook.com/fql',
data: { 
    q: 'select share_count from link_stat where url="https://www.grammarly.com/blog/2015/what-is-the-oxford-comma-and-why-do-people-care-so-much-about-it/"'
}

The post itself https://www.grammarly.com/blog/2015/what-is-the-oxford-comma-and-why-do-people-care-so-much-about-it/

For comments I use this plugin https://wordpress.org/plugins/facebook-comments-plugin/

Moreover, if I share a post now, the count won't increment. New comments count and appear as expected.

Thanks


Solution

  • Using the debugger you can see the error: https://developers.facebook.com/tools/debug/og/object/?q=http%3A%2F%2Fwww.grammarly.com%2Fblog%2F2015%2Fwhat-is-the-oxford-comma-and-why-do-people-care-so-much-about-it%2F&__mref=message_bubble

    If you scroll down, you'll find a card with the title "To help you debug, these are the canonical URLs this URL used to point to"

    As you can see, all your old likes are assigned to your non-secure URL (http://www.grammarly...) but now, your og:url tag is pointing to your secure URL (https://www.grammarly...)

    Even if this is the same domain, these URLs are inherently different so Facebook crawler treats them as two different URLs.

    This is explained at Facebook docs: https://developers.facebook.com/docs/sharing/webmasters/crawler#canonical

    You should use always the same canonical URL for every version of your URL. Quoting the docs:

    This ensures that all actions such as likes and shares aggregate at the same URL rather than spreading across multiple versions of a page. This also means that different versions of the same content will be treated the same, even if they're hosted on separate subdomains or are accessible over both http:// and https://.

    So you have not lost your likes/shares, they're assigned to a different URL.

    As a workaround you can change your og:url tag to point to your non-secure URL or detect facebook user_agent (facebookexternalhit/1.1) and redirect always to your non-secure URL.

    I hope this helps.