I like to publish drafts in my ‘Uncategorized’ category. This category is not linked anywhere on my site. It’s great for allowing contributors to an article to read the draft before it is made public. The problem is that after just 2 or 3 days, search engines begin picking up the draft and people start posting comments.
I don’t want to password protect the draft. Is there some way to hide it from search engines while it is in the ‘Uncategorized’ category?
How about something like this on your
functions.php
:This will output the following line of code on the header of your ‘uncategorized’ posts:
What this means is that even though search engines will see the page, they will be told to ignore it and don’t show it on their results.
Something like this in your
robots.txt
?Since there is no link anywhere in your blog, you should only be concerned by the category archives; in this way search engines should not crawl those parts of your site.
Is there any other way that your drafts are accessible? You might consider also modifying the
category-uncategorized.php
template file, so that those posts are in no way accessible without having a direct link.