Remove rel='canonical' on Comment pages
-
Hello,
After enabling the “Break comments into pages” option in Admin panel, WordPress generates a specific page for every 50 comments:
https://www.post-link/comment-page-1/
https://www.post-link/comment-page-2/
…
https://www.post-link/comment-page-n/But because of the rel=’canonical’ in the <head>, none of the comments pages gets indexed (except of the /comment-page-1/ which is actually the post page).
Is there any way to remove the rel=’canonical’ from the /comment-page-n/ links? Or set the canonical link as https://www.post-link/comment-page-n/ rather than https://www.post-link/ ?
The 50 comments bring more value to the post and there won’t be problems with duplicate content.
I know I can completely remove the function by adding
remove_filter(‘wp_head’,’rel_canonical’);
in my theme’s functions.php, but that will remove rel=’canonical’ from all the pages and I don’t want that.
Thank you in advance!
- The topic ‘Remove rel='canonical' on Comment pages’ is closed to new replies.