-
Hello,
I am trying to add self canonical tags to our faceted canonical pages.
Currently I am using filter everything plugin which gives canonical tag to paginated pages as the first pageadd_filter( 'rank_math/frontend/canonical', function( $canonical ) { $current_url="https://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; if(false === strpos($current_url, '/page/')) return $canonical; $canonical = strtok($current_url, '?'); return $canonical; });I am using this code. But it didn’t work.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The ticket ‘How to give self referencing canonical tag to paginated pages’ is closed to new replies.