I am currently using the wordpress seo plugin by yoast, and have run across a problem trying to remove the following tag:
rel="canonical"
The canonical tag is ok on a page such as blog.com/page/, however, on pages such as blog.com/page/2/ I don’t want the canonical tag to show up.
I’ve done some googling and haven’t been able to find quite what i’m looking for so im hoping stack overflow will save the day.
2
Answers
The WordPress SEO plugin has a filter you can use to disable the canonical URL on the pages you mention above.
In your functions.php file, add:
The WordPress function is_paged() returns true if the page being displayed is “paged” and the current page number is greater than one.
Returning false to the filter disables it.
@bobdye Answer has no effect for me, but this works: