• Resolved James I.

    (@nootropixcom)


    Hi,
    I need to disable rel=”canonical” and the og:url meta tag but this really straightforward snippet that I found in this forum doesn’t work (I added it in theme’s functions.php):
    add_filter( 'wpseo_canonical', '__return_false' );

    It doesn’t do anything at all. Maybe this hook is called before Yoast SEO is loaded (so it just gets overwritten)? That could be a plausible reason.

    But it doesn’t matter which method, I just need to know how can I disable canonical and og:url as I don’t want duplicates that confuse crawlers.
    Help, please, I’m going crazy over this ??

    Cheers,
    G

    https://www.ads-software.com/plugins/wordpress-seo/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter James I.

    (@nootropixcom)

    bump..

    Plugin Support amboutwe

    (@amboutwe)

    You have the correct code to remove the canonical code.

    To remove the OpenGraph url, you’ll need an additional code snippet:
    add_filter('wpseo_opengraph_url' , '__return_false' );

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Need to remove canonical url and og:url – but the hook doesn't work’ is closed to new replies.