Rel canonical removal added by Yoast SEO plugin

Could not find a solution after a quick google, so I thought that I would quickly post a post here.

An attempt to remove the automatically added rel = canonical link (which is added by the Wordpress SEO plugin - from Yoast).

I really want google to crawl each of the different sub-sites, even if it cannot move away from the parent page.

+8
wordpress wordpress-plugin
source share
5 answers

rel = "canonical" has nothing to do with traversal. This is due to indexing and prevents indexing the same page twice or more.

In any case, if you still want to do this, you can do this by adding this code to your functions. php:

add_filter( 'wpseo_canonical', '__return_false' ); 

Source: https://yoast.com/wordpress/plugins/seo/api/

+11
source share

You can also use this in wordpress conditional tags

Refer: https://codex.wordpress.org/Conditional_Tags

 // Remove - Canonical for - [Search - Page] function remove_canonical() { // Disable for 'search' page if ( is_search() ) { add_filter( 'wpseo_canonical', '__return_false', 10, 1 ); } } add_action('wp', 'remove_canonical'); 

Remove canonical for ALL pages.

 // Disable Canonical for - ALL pages function remove_canonical() { add_filter( 'wpseo_canonical', '__return_false', 10, 1 ); } add_action('wp', 'remove_canonical'); 
+8
source share

most likely the canonical one is not generated by yoast, there is a built-in wordpress function that you can prevent by adding this to the functions of your function. php

 remove_action('wp_head', 'rel_canonical'); 
0
source share
 remove_action('wp_head', 'rel_canonical'); 
0
source share

You can also disable canonical URLs for wordpress. See here: Desactivar rel = "canonical" from Yoast WordPress SEO o de WordPress

-3
source share

All Articles