Wrong canonical in wp_head – how to remove in WP 4.5.2
-
Hi,
Is there a way to remove WordPress’ (4.5.2) own rel_canonical link in head section of HTML?
So far I tried to add
<?php remove_action('wp_head', 'rel_canonical'); ?>
to my functions.php of my theme, which doesn’t do anything.
I also tried it in my themefiles.php before and after calling wp_head();
Did the name of the action change? Is it not a action? How can I figure that out? I don’t get further here.I also tried
/* remove canonical /*---------------------------------------*/ function at_remove_dup_canonical_link() { return false; } add_filter( 'wpseo_canonical', 'at_remove_dup_canonical_link' );
like above – no effekt, the canonical is still showing wrong.
my other remove_actions work fine.
I run WP 4.5.2 as a multisite, subdirectory network.
It shows wrong, because it shows just the URL of the request. So it shows https://whatver or https://whatever – it should always be https://whatever in this case. I can do that whith All in One SEO (AiOSEO) which I like to use. But in addition to the correct canonical from AiOSEO I have a second and wrong canonical of WordPress as well.
Cheers
- The topic ‘Wrong canonical in wp_head – how to remove in WP 4.5.2’ is closed to new replies.