• Resolved denispoeta

    (@denispoeta)


    Hello everybody. I use Yoast SEO and I had to migrate from http to https. After migration I lost the count of pages’ sharings: I would like to get that count back. I tryied the solution provided here but wasn’t able to get the result I want.Getting in the details, I’m having some trouble on getting the og:url changed to “http” (the previous shared version). I added the filter

    add_filter( 'wpseo_opengraph_url', 'my_opengraph_url' );
    function my_opengraph_url( $url ) {
            return str_replace( 'https://', 'https://', $url );
    }

    in the function.php but og:url didn’t change from https to http. I need this to get back my previous Social share count after migrating from http to https (I don’t know if .httaccess rewrite of every http request to https may affect this parameter/facebook crawler).
    Anybody could help please? Thank you.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support amboutwe

    (@amboutwe)

    If you have cache enabled, please make sure you cleared cache.

    If you have cleared cache and the issue remains, please provide links to a few pages on your site that are not working.

    Thread Starter denispoeta

    (@denispoeta)

    Thank you for the reply. Yes, I cleared the cache. The link to the home page is https://www.fiscoecontabilita.it/
    Thank you again

    Plugin Support amboutwe

    (@amboutwe)

    After reviewing your site, it appears you have something (plugin, theme, custom code) that forces the https after the html is generated which overwrites the changes made with the code above.

    The fastest way to rule out conflicts is to deactivate all non-Yoast plugins and switch to a standard theme like Twenty Seventeen. If this resolves the issue, you have a conflict and should activate one plugin at a time until you locate the conflict. Finally, after all plugins are active, switch to your theme. This will narrow down the conflict to a specific plugin or theme.

    If you are unfamiliar with checking for conflicts, we wrote a small guide that will walk you through the steps. You can find it here: How To Check For Plugin Conflicts

    Hi there!

    I have successfully added the code into functions.php and from what I can see, the scraper is correctly picking up the http url in og:url, however I’m still not getting the old counts.

    Looking at the Canonical URL on the sharing debugger it’s still showing the https URL. Furthermore under the section: Based on the raw tags, we constructed the following Open Graph properties is also showing the https URL. Any ideas?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to Change Og:url after migrating https and keep your social counters’ is closed to new replies.