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:
- You already have a plugin that handles your canonical links.
- You use canonical links within WordPress without a plugin.
- You have a site that requires site wide external canonical urls.
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:
- Login to WordPress
- Hover over Appearance
- Click Editor
- Find Theme Functions (functions.php)
- 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.