-
I am trying to remove canonical tag on some custom dynamic pages with
remove_action('wp_head', 'rel_canonical')
or setting the canonical tag that I need withadd_filter( 'get_canonical_url', 'custom_set_canonical_url', 10, 2 )
. None is working. Is it possible the plugin is preventing it from working?
I tried using a filter I found in your website:add_filter('rank_math/frontend/canonical', function ($canonical) {
global $wp;
return home_url($wp->request);
});But still, the pages are showing the canonical to the original page url. But these pages are dynamic and are accessed via multiple URLs and each one is for different content.
The ticket ‘Setting or clearing canonical tag’ is closed to new replies.