Your site might be affected due to missing noindex, follow at subpages

As we know, Subpages in WordPress are basically for navigation from page 1 to page 2 and so on.


Sample permalinks.

Ideally, to avoid indexing with duplicate Title, it is recommended to have noindex, follow meta robots attribute.

You might know well, earlier Yoast SEO Plugin was providing an option to noindex subpage in Title & Metas > Other location.


I am shocked to see, in the latest version not only settings is missing but also noindex, follow attribute is missing from the Subpages. Not cool.

Now, those website who are using Yoast SEO Plugin latest version, I think they are near a Google penalty.

I came to know about this issue today morning, when I was doing technical SEO audit for a website using Semrush and got a warning that X numbers of pages having Duplicate titles.

How to know if your WordPress site is missing proper robots tag for Subpages?

  • Type in address bar:
  • CTRL+F <meta name="robots" content="noindex,follow"/>
  • If it is showing, good else bad.

How this problem can affect your Site SEO?

  • Missing noindex,follow robots attribute for subpage can potentially harm SEO by indexing subpages with Duplicate titles.
  • In Google Search Console, soon you may see warning that you have Duplicate Title in the HTML Improvement section.

Here’s the workaround for the quick fix

  1. Add a new plugin called “Code Snippets”
  2. Add a below code as a new Snippet and save changes.
  3. Don’t forget to Purge Page Cache.

function gk_subpage_fix() {
if(is_search() || is_archive() || is_404() || is_feed() || is_paged() || is_attachment()) echo '<meta name="robots" content="noindex,follow"/>';}
add_action('wp_head', 'gk_subpage_fix');

Revised version 2, edited by @Hitesh

function gk_subpage_fix() {
if(is_paged()) echo '<meta name="robots" content="noindex,follow"/>';}
add_action('wp_head', 'gk_subpage_fix');

Thanks & Regards,


I’m on older version of Yoast, and the subpage is set to noindex. And my entire homepage is indexed 400-500 times, what the hell is wrong :sob:

Shall I enable and disable, please look into it via PM.

Check subpage source code of subpage URL, is there missing noindex, follow robots meta tag?

1 Like

What about his?

1 Like

One problem, if I add the code you have mentioned, it adds Noindex, Follow on subpages along with archives, search pages, 404s etc where Noindex is already present.

Two Noindex tags on the same page, one by Yoast one by this.

Update: This code is enough if you are using Yoast.

function gk_subpage_fix() {
if(is_paged()) echo '<meta name="robots" content="noindex,follow"/>';}
add_action('wp_head', 'gk_subpage_fix');

@GulshanKumar I think @Hitesh is correct. This code is enough because search, archive, 404, feed and attachment pages still have noindex, follow tag. So we only need to place this code in function.php file.


@Pramod Yes, he is corrected 100%. I shown him support by liking his reply. :slight_smile:
Thanks @hitesh for correcting the snippet.


Yoast updated 2 days back right? 20% rise in pageviews since 2 days. The possible reason

“Noindexing all these pages leads to a lower amount of crawls for them (source), which subsequently leads to lower amounts of crawls for older articles, which is not a good idea on most sites.””

Considering that i have 2100 articles on my site, and many of the older articles were not ranking. Suddenly since last 2 days even older articles are receiving hits. Small hits but surely they are there. Can it be due to indexing of sub pages?

1 Like

If anyone wants to go back previous version of Yoast then it can be downloaded from here:

Would never recommend this. You will be outdated in 5 months then. Yoast keeps updating.

1 Like

I don’t think so. Are they related? I doubt. It is useful if you have subpages of articles. Some sites do, like tech site who divide review section into software, hardware, camera - useful for them, but not for us?

for examle: Redmi Note 5 camera review, if you have sub page for this and SEO optimized, you can outrank a simple site’s Redmo Note 5 review which has camera part as a sub heading.

My concern was this. I have articles which are 5 years old!

Yes thats right, but better to remain safe for some time, until it is not clarified that indexing subpages are good or not.

1 Like

Gotta wait for John’s reply. Also going to ask some old webmasters.


Currently I don’t have HTML improvements Duplicate heading etc related warning in the search console due to Noindex of subpages. Anyone seen any issue after indexing subpages of archives?

1 Like

No need to make any changes. Here’s Google’s response:

1 Like

Dear friends,

I tried to update the code, But the template returned ERROR? Kindly let me know how to solve this?

Please do not add directly. Consider using using proper plugin - Code Snippets for it.

Ok bro.