Archived topic
Deindexing paginated archive pages (NOT PAGE 1 of an ARCHIVE!)
7 replies · Started by Mark on February 8, 2023
Hi there,
I just want to make sure if this code will do the trick. I'm trying to save crawl budget and I don't think anything after page 1 in an Archive needs to be indexed. In fact, deindexing anything after page 1 should help SEO?
This would go into functions.php
1) Can you confirm the code will work
2) Is there any way to test to see if it worked other than waiting to see what Google displays in a search?
3) Do you think this is a bad idea?
URL examples in the private area.
Thanks in advance!
Mark
Hi Mark,
I believe this inquiry will be more suited for an SEO-expert.
It may be good to ask for insights in our Facebook Group as well: https://www.facebook.com/groups/1113359788719597
This article may also be insightful: https://www.searchenginejournal.com/noindex-category-archive-pages/374867/#close:~:text=Crawl%20Bloat%20%26%20Index%20Bloat
Ok, will check it out.
Will the code work?
Which code? I don't think a code was shared.
Whoops, sorry! Here it is:
/*
==================
Set Sub-Pages of Archives to Noindex
==================
*/
function mtt_noindex_paged() {
if ( is_paged() ) {
echo '<meta name="robots" content="noindex,follow" />';
}
}
add_action('wp_head', 'mtt_noindex_paged');
/*
==================
END OF Set Sub-Pages of Archives to Noindex
==================
*/
Yes, that should work for paged pages.
More information about that code here: https://developers.google.com/search/docs/crawling-indexing/robots-meta-tag
Thanks Fernando. Will check that out
You're welcome, Mark!