How to noindex in WordPress

NOINDEX Meta Tags for WordPress

It is smart to begin with a caution before you learn how to NO-Index certain parts of your WordPress built website. Because getting these noindex directives for () like wrong, will have drastic results for your website built on WordPress. Now that you are warned.

The easiest way to parts of a WordPress site is to use Meta Tags which you can place within the header.php head section (simply locate <head>portion of HTML</head>)

How to noindex WordPress Page

<?php if (is_page('nameOrIDofyourWordPressPage') : ?>
<meta name="Googlebot" content="noindex">
<meta name="robots" content="noindex">
<?php endif; ?>

Both WordPress page ID and Post ID can be found through the browser address bar as shown in this image:

Shows WordPress Post ID in Browser Address Bar
Shows WordPress Post ID in Browser Address Bar

How to noindex a Single Blog Post in WordPress

<?php if (is_single('nameOrIDofSingleBlogPost') : ?>
<meta name="Googlebot" content="noindex">
<meta name="robots" content="noindex">
<?php endif; ?>

How to NoIndex WordPress Tags

<?php if (is_tag() : ?>
<meta name="Googlebot" content="noindex">
<meta name="robots" content="noindex">
<?php endif; ?>

How to NoIndex a Single Category

Let’s imagine that you want to keep category with an ID 7 out of Google index, simply locate the Category ID (WordPress Dashboard > Posts Categories > Edit (and look for tag_ID=?)) as that’s your category ID. Then, you would use something like this:

<?php if (is_category('7') : ?>
<meta name="Googlebot" content="noindex">
<meta name="robots" content="noindex">
<?php endif; ?>

How to noindex Attachments in WordPress

All the you insert within your posts get their own URL’s as well. And if you want to noindex them, then use:

<?php if (is_attachment() : ?>
<meta name="Googlebot" content="noindex">
<meta name="robots" content="noindex">
<?php endif; ?>

How to noindex Search Results

<?php if (is_search() : ?>
<meta name="Googlebot" content="noindex">
<meta name="robots" content="noindex">
<?php endif; ?>

Or You Can Use Below Codes to noindex Search Results

<?php if (is_search()) : ?>
<meta name="description" content="<?php echo esc_html( get_search_query( false ) ); ?> is search query conducted on <?php bloginfo('url'); ?> website.">
<meta name="keywords" content="<?php echo esc_html( get_search_query( false ) ); ?>, search results page">
<meta itemprop="description" content="<?php echo esc_html( get_search_query( false ) ); ?> is search query conducted on <?php bloginfo('url'); ?> website.">
<meta itemprop="keywords" content="<?php echo esc_html( get_search_query( false ) ); ?>, search results page">
<meta name="Googlebot" content="noindex">
<meta name="Googlebot" content="follow">
<meta name="robots" content="noindex">
<meta name="robots" content="follow">
<!--searchqueries-->
<?php endif; ?>

As I’ve said at the beginning of this blog post, you have to be very careful about using noindex directives because what you are telling search engines is that they should not place that part of your WordPress in their index. And thus, no rankings for those parts of your website.

Do NOT Use robots.txt Directives for noindex

Most WP site owners believe that if they just use file to deny access to certain parts of their website, then, those parts of the website will not be in Google search results.

However, that is not going to work for WordPress built sites because of . Meaning, even if you use robots.txt file directives you still need to use specifically telling search engine to NO-INDEX parts of your website.

When Should You Use These

There is no set answer for this because each website is different. Perhaps the logic should be “do you have any unique content?” on the part of your website that you want to use noindex tags. Because you for keywords that are within the uniqueness of your URL’s

As far as your pages, posts, products are  then you can be more confident in your usage of noindex.

Furthermore: keep in mind that even if you get things wrong, then its just a matter of removing those tags and let Google re-crawl and re-index your website. If you want to speed this process up, then, share those URL’s you noindexed in the first place and things should be back to normal.

72 / 259 Malvern Rd Melbourne Australia 3141

+61421600702 $$

Author: RankYa

RankYa: Online Entrepreneur, Web Developer, Google AdWords and Google Analytics Certified Professional. Specialist in: SEO, Website Optimization, WordPress, Structured Data, JSON-LD, Microdata, Microformats, RDF, Schema.org Vocabulary, HTML5, Advanced Image Optimization, Google Webmaster Tools, Google Webmaster Guidelines, Social Media Marketing, Facebook marketing and YouTube video ranking mastery.

Thank you for sharing this blog post. Description: 'How to noindex in WordPress the right way shows, how to noindex WordPress pages, single blog posts, no-index tags and even categories THE RIGHT WAY'