Yoast SEO: How to Disable Canonical Links & URLs

and published
yoast disable canonical urls

Yoast SEO is a great and light plugin for WordPress and with over 3 million active installs and over 10,000 reviews it is one of the most successful, reliable and demanded plugins that exists on the WordPress plugin directory. Yoast SEO is simple to use and does not overwhelm users with thousands of options that they simply don’t need.

One option in particular that is missing from Yoast’s Dashboard is an option that disables the canonical urls feature entirely, it should be noted that it does have an option to add custom canonicals to both pages and posts, this is extremely helpful for using external canonical links that can help you avoid Google’s panda algorithm when posting duplicate content.

The reason that I mention all of this is because you only should want to disable canonical links being handled by Yoast if:

Filter to Disable Canonical URLs

add_filter( 'wpseo_canonical', '__return_false' );

Steps to Disabling Yoast Canonicals

You can disable canonical links being added to the HEAD by following these simple steps:

  1. Login to WordPress
  2. Hover over Appearance
  3. Click Editor
  4. Find Theme Functions (functions.php)
  5. Add the code found above to a new link within your functions.php

Just a few Custom Canonical Links

If you want Yoast SEO to handle your canonical urls but you have a handful of posts and pages that require a different source url then you can find this information here.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

7 Responses to “Yoast SEO: How to Disable Canonical Links & URLs”

  1. Hansjörg

    How can I disable the canonical link for AMP-Posts only?


    • As far as I know as off WordPress version 4.9.5 does not support native AMP, therefore, you must be using a Plugin. That plugin should have a ‘hook’ where you can create a filter with IF statement, e.g if `amp_enabled`, have a look at the development thread of your plugin or on GitHub.

  2. Hello, How can I disable canonical only for blog page? thank you, Simon.

  3. Emploi Dakar

    Works fine


    Very good, thank you team BYBE.

  5. Kalpesh

    Thank you very much !! Very help full.