-
Hello,
Something like 1 year before, Michael Davis gave the tip how to remove the canonical tag from specific page. The code is as follows:
/**
* Allow changing of the canonical URL.
*
* @param string $canonical The canonical URL.
*/
add_filter( ‘rank_math/frontend/canonical’, function( $canonical ) {
//create conditional here to check for the tax page
if(condition){
return ”;
}
return $canonical;
});My question is – is this a right code to remove canonical from specific page (not whole taxonomy type)? And whre in this code can I insert the page url or id?
The ticket ‘Remove Canonical tax from specific page’ is closed to new replies.