Adding No Index Tags to Low Value WordPress Pages

WordPress auto generates a lot of low value pages like the search results pages (generated if you use the wordpress search feature), the 404 error pages which are generated in-case of requests to non-existent pages and archive pages that have links to your blog posts categorized into date (yearly, monthly and daily), authors, tags and categories. Also, depending on the number of posts your blog has, the archive pages can run into several paginated pages. As these pages have little to no original content, it is a recommended SEO measure to block them from getting indexed by search engines.

This can be easily done by adding the robots noindex,follow tag within the head section of these pages. A 'noindex,follow' robots tag tells the search engine bot not to index the page but still follow the links on the page. This means, the search engines will actively crawl the page and follow the links on the page but will not index the page but the page will not be included in the search engine results pages.

Adding Noindex Tags to WordPress Archive Pages

If you are using the Yoast SEO plugin, you can achieve this by going to SEO > Titles & Metas > Taxonomies and Archives and then checking on the noindex, follow checkbox underneath, categories, tags, author and date archive sections. If you are not using the plugin, you can achieve this by adding the following function to your theme's functions.php page.

Here are the steps to do this:

Step 1: Login to your wordpress dashboard and click on 'Appearence > Editor'.

Step 2: Now click and open the functions.php page from the right panel.

Step 3: Add the following code towards the end of the page:

/*Add noindex to low value pages*/
function add_noindex_tags(){
	# Get page number for paginated archives.
	$paged = intval( get_query_var( 'paged' ) );
	# Add noindex tag to all archive, search and 404 pages.
	if( is_archive() || is_search() || is_404() )
	echo '<meta name="robots" content="noindex,follow">';
	# Add noindex tag to homepage paginated pages.  
	if(( is_home() || is_front_page() ) && $paged >= 2 )
	echo '<meta name="robots" content="noindex,follow">';
add_action('wp_head','add_noindex_tags', 4 );

Step 4: Scroll down and click on 'Update File'.

This will add a noindex,follow tag to your search pages, 404 pages and all your archive pages, be it a category, tag, author or the date archives page. In addition to that, the function also checks if the homepage/frontpage is paginated, and adds a noindex tag to paginated homepage/frontpage pages.

Adding Noindex Tags Only to Subpages of Archives

An archived sub-page is a paginated page that follows after the main archived page. For instance, for a category named 'technology' the following will be the main and sub pages:

Main page:

Sub pages:

If you would like to add the robots noindex tag only to the subpages of the archives, or in other words, allow the first page to be indexed and then add a noindex to all the inner paginated pages, then you can achieve this by adding the following to your functions.php page:

/* Add noindex only to paginated subpages of archives, search and 404 pages */
function add_noindex_tags(){
	$paged = intval( get_query_var( 'paged' ) );
        if(is_search() || $paged >= 2  || is_404() )
	echo '<meta name="robots" content="noindex,follow">';
add_action('wp_head','add_noindex_tags', 4 );

Note: This will add a noindex tag to paginated pages of homepage, author archives, category archives, tag archives, and date archives.

Adding Noindex Tags to Specific Pages

You might also want to add the noindex tag to a few non-useful pages like the privacy page, disclaimer page, contact page etc. This can easily be achieved using the is_page() function and adding the page Ids in an array.

For example, if you would like to add a noindex to pages with the ID 14 and 22, you can use the following:

# Add noindex tag to specific pages.  
if( is_page( array( 14, 22 ) ) )
echo '<meta name="robots" content="noindex,follow">';
Note: Make sure to copy this code inside any one of the functions above.

This way you can add a comma separated list of as many pages as you want inside the array. Similarly, if you would like to add nofollow to specific posts, replace the is_page function with the is_post function.

This is how you can add a noindex to tag to unwanted or low value wordpress pages. In addition to adding this tag, you might also want to add the Prev and Next meta tags to paginated archives. Check out this article to know how to do this.

Hey guys, I just released my SEO plugin Quick and Easy SEO Tool which is currently available for download. I designed this plugin with simplicity in mind and I am really happy with the way it has turned out. Please do download and checkout the plugin from the wordpress repository here:

You can also download the plugin from your wordpress dashboard by searching for 'Quick and easy seo tool by Mukesh Mani'. Your feedback is appreciated.



  1. Sylvie says:

    Great post, Mukesh! Thank you very much for sharing this content. That's exactly what I was looking for.

  2. MacDeL says:

    God bless you for this, exactly what I was looking for, no other sites gave a step by step method on how to do this.

  3. Orhan says:

    I've been looking for it for three months.

    Very very thanks :) you're great!

  4. Dona says:

    Hey Mukesh,

    Thank you for writing this post.

    I have a blog running Genesis Child Theme and on the hompage at the very end near the footer I have this pagination. Which lists all the articles on my blog so after homepage if someone clicks on any of those it will show something like:

    Now these are pages that I do not want to be indexed. I want the homepage to be indexed of course but all these pages in the pagination I don't want them to be indexed.

    I have already removed the "PAGINATION" at the bottom of the homepage however there is this issue: all these pages are indexed and I want to add no-index.

    Because I have more than 30 pages of content this whole scheme continues to page 30.
    ....... all the way to

    All this is duplicate content and is being indexed in Google. How do I deindex it?

    Google is considering it all as duplicate content because these pages add no value and they are just archive. How can I make sure that everything gets noindex?

    Thank you very much in advance Mukesh.

    • M Mukesh says:

      Hi Dona, if I am not mistaken, what you are referring to are homepage paginated pages. you can easily add a Noindex tag to these pages by using the code mentioned under "Adding Noindex Tags to WordPress Archive Pages" sub-heading in the article.

  5. Hassan says:

    Hi, I created pagination in post using the . My post is split into 5 pages. But now the problem that I am facing is that Search Engines are indexing all these 5 pages. Example:,,,

    I only want my main post page to be indexed and not these sub pages. Can you please tell me what can I do to stop search engine from indexing these subpages? P.S I have already installed Yoast SEO and have set Subapages of Archives to NO Index.

    • M Mukesh says:

      Hi Hassan,

      I am assuming you split these pages using the 'nextpage' tag.

      I don't think Yoast has a functionality to add robots tags to paginated single post pages. 'Archive Sub-pages' do not equate 'Paginated single post pages'.

      You can verify this by viewing the HTML source of these paginated pages to see if a robots tag is present. I am pretty sure you won't find any.

      To add a 'robots noindex' to these pages, you can add the following code to your functions.php page:

      function noindex_paginated_single_posts(){
      $paged = intval( get_query_var( 'page' ) );
      if( $paged >= 2 )
      echo '<meta name="robots" content="noindex,follow">';
      add_action('wp_head','noindex_paginated_single_posts', 4 );

    • Shyam says:

      First of all Thank you Mukesh for writing a great post now question for Hassan,

      Hassan I'm having the same problem on my site that you are facing, Bro have you able to solve your problem with this code or my mean is that code works?

      I was searching for many days but only here i find the code for noindex paginated single post but don't know it will work or not. hey Mukesh if that code works make it part of your main article bcoz It can help many peoples like me.


    • M Mukesh says:

      Thank you Shyam. Yes, I will include that code in the article soon.

  6. Hassan says:

    Thanks, Respected Sir for your response. I will surely add this code and share the results with you.

  7. Arun Kumar says:

    Very useful article.

  8. Oyegoke Samuel says:

    Hi thanks for this wonderful article. please is there any code to noindex all attachment pages? Yoast doesn't seem to be doing the task effectively

  9. Vlado says:

    I also use Yoast plugin for putting noindex, nofollow to date archives pages. However what I found out is that Google still index those pages. So I decided to put them in robots.txt. Because of URL structure it was not easy but I made it and explain it in this post: .

  10. Nishita says:

    Hi Mukesh,

    I have added the code mentioned under "Adding Noindex Tags to WordPress Archive Pages" sub-heading in the article. Only thing is I added this code after I realized google had indexed home and blog paginated posts.

    After a few days of adding the code, I see Google has deindexed the home pagination but the blog page continues to remain. I also want to deindex the author paginated urls. What can I do?

    • M Mukesh says:

      Hi Nishita, use the code under the heading "Adding Noindex Tags Only to Subpages of Archives". This will add a noindex to all paginated pages be it homepage, blog, category, tag or author.

  11. Nitin says:

    Hi Mukesh,

    How to add "Noindex" tag to Subpages of Search Result Page?

    • M Mukesh says:

      Hi Nitin, you can use the following function:

      function add_noindex_tags(){
      # Get page number for paginated archives.
      $paged = intval( get_query_var( 'paged' ) );

      # Add noindex tag to sub pages of search pages
      if( is_search() && $paged >= 2 )
      echo '';
      add_action('wp_head','add_noindex_tags', 4 );

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.