DISCLAIMER: this post is older than one year and may not be up to date with latest WordPress version.

Most of the time, you want your posts to be indexed by search engines as such as Google as soon as possible. But if for some reason, you don’t want a particular post to be indexed by search engines, just read on!

To achieve, first get the ID of the post you’d like to be not indexed by search engines. In this exemple, I assume your post id is 17.
Open your header.php file and paste the following code between the <head> and </head> tags:

 <?php if ($post->ID == 17) {
    echo '<meta name="robots" content="noindex">';

That’s all. Pretty useful if you don’t want some infos to be accessible from search engines!
Note that it is possible to do something better by using custom fields. If you’re interested about this second method, just leave a comment and I’ll write a recipe!



  1. Hello 🙂 good article. i would be interested in the custom filed method too

  2. Good article,thanks for posting.
    How do I confirm that the Google is not crawling the article which I do not want to index. I guess through source code of this article but is there any other idea where I can test like on webmaster or any google product.

    Thank you

  3. In my early days of learning WordPress, I found myself coming to your site on several (countless) occasions. These days, it always makes me smile to stumble upon another one of your links.

    So, thank you once again!

Leave a Comment

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