WordPress Category Noindex: How To Disable Search Engine Indexing On A Category

Steven3 responsesWordPress

For any reason, you may want to disable search engine indexing on a specific category of your WordPress blog: the category page as well as all the posts in that category.

The very first thing to do is to get the ID of the category you’d like to not be indexed by search engines. Browse to the Posts/Category page in your WordPress admin. When you put your mouse over the given category, you’ll notice that a link appears in the status bar of your web-browser. This link includes the category ID.

In the following example, I’ll assume your category ID is 5.

Open the header.php file of your WordPress theme and paste the following code between the <head> and </head> tags:

<?php if ( is_category('5') || in_category('5') ) {
  echo '<meta name="robots" content="noindex" />';
} ?>

Learn how I made $33,543 online in the past 12 months.

Simply input your best email below to get started.

3 Comments

  1. Chittagong

    I loved it and applied it on a category on my blog and worked well. Thank you.

  2. Promo Couponz

    Thanks for nice article……. I have applied the code on my blog to prevent indexing.

    1. I’m glad it helped.

Learn how I made $33,543 online in the past 12 months.

Simply input your best email below to get started.

No thanks, I have enough money