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>