• Resolved J

    (@paradox_designs)


    Can this or the pro version allow to globally override the og:url to make the “canonical” url essentially http despite the actual site url being https?

    Or alternatively maybe the plugin offers a solution to this problem that I am not aware of.

    The problem, we switch a site from http to https and suddenly all the like button counts went to zero. FB debug is basically indicating that it is treating http and https as different urls (which is silly). When we switch back to http like count goes back to normal, but we want to keep the site secure.

    I found no way to tell facebook that this is the same url, or how to migrate likes, or how to consolidate them. Is there a way?

    The only way I found is to use the rel=canonical and make it the http version. BUT all the open graph plugins add the og:url which overrides the rel=canonical line and none of the open graph plugins allow me to either change the https to http across the entire site or simply to disable the og:url.

    In this plugin i see the check box to remove the og:url but I cannot click it.

    Any idea what to do in this case?

    Thanks.

    https://wordpress.org/plugins/wpsso/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author JS Morisset

    (@jsmoriss)

    You can hook the ‘wpsso_sharing_url’ filter to modify the URL as you wish. You can find some filter docs / examples here: http://wpsso.com/codex/plugins/wpsso/notes/developer/filters/

    js.

    J

    (@paradox_designs)

    Thanks, but I’ve looked at the code here and:

    1. I don’t understand how this would work in my case. I need to change the base of the url, not the post ID, the post ID is the same.

    2. Does this actually change the og:url in the meta tags? or does this change the url that gets posted or linked to if people post this page to facebook?

    Thanks

    Plugin Author JS Morisset

    (@jsmoriss)

    Off the top of my head, this should work:

    add_filter( 'wpsso_sharing_url', 'wpsso_sharing_url_force_http', 10, 1 ); 
    
    function wpsso_sharing_url_force_http( $url ) {
        return preg_replace( '/^https:/', 'http:', $url );
    }

    More info here: http://php.net/manual/en/function.preg-replace.php

    js.

    J

    (@paradox_designs)

    I have tried this code and several other variations like :

    add_filter( 'wpsso_sharing_url', 'wpsso_sharing_url_force_http', 10, 1 ); 
    
    function wpsso_sharing_url_force_http( $url ) {
        $url = str_replace('https://', 'http://', $url );
        return $url;
    }

    It is just not working. I still end up with a
    <meta property="og:url" content="https://www.website.com/">

    I am placing this in functions.php. Is the https somehow being added after this code? what am I missing?

    Thanks

    Plugin Author JS Morisset

    (@jsmoriss)

    Don’t forget that WPSSO caches the meta tag block for 1 day, so any change you make will not appear immediately unless you clear it’s cache (click the “Clear All Cache” from any SSO settings page).

    js.

    J

    (@paradox_designs)

    Ok, turns out Really Simple SSL plugin has “force change mixed content” which meant it kept forcing every link on the site to http… all good now.

    Thanks for the always awesome support!

    Hello JS Morisset
    I tried using this and it didn’t seem to work.
    Any chance to add this as a feature to the plugin?

    Thanks.

    Update: when I changed the priority from 10 to 5 it did work.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Is there a way to make all fb og:url tag to use http despite url being https?’ is closed to new replies.