We are stumbeling upon an issue of content being found on our website to early. For example, we have a post named 'Client X' we have associated the category 'unpublished' to it. We don't want this post to be found on any site, however, some websites do find this posts.

What we did is:

  • Add noindex to the post when in category 'unpublished' > this works, google does not pick it up
  • Removed the post from sitemap generation
  • Removed the post from oursite.com/feed (all possible feeds)
  • Removed the post from API (/wp-json/wp/v2/posts)

Still the post is found by some crawlers. For example: http://explore.finchline.nl/ this website picks up the post when you search our website.

PS: We don't want to unpublish or password protect the post (for other reasons). It needs to have WP status published.

I just found out 2 other ways this post could be found:

  • oursite.com/2017/
  • oursite.com/?post_type=post

Since I have already stumled upon like 5 different ways that this post can be found I am afraid that this won't solve it. What other ways are there to find the content of a site? In other words, what do I need to do to make sure the post is never found as long as it is in the category 'unpublished'.


  • So you want an accessible post that isn't accessible? Or is the problem that you just don't want it to be in search engines? If it's visible to a user when visited, then there's no 100% foolproof way of doing this, after all Google might respect robots.txt or noindex directives, but others might ignore it – Tom J Nowell Mar 27 '17 at 13:54

Since you aren't able to use the out-of-the-box functionality (i.e. not publishing the posts!) you will inevitably have to cover yourself in a few different ways. You seem to have most of them covered - but a couple more ideas:

  1. The single post page itself. Assuming you are OK with the post never being visible at all from the public-facing website, you could write some code at the top of your header file that checks if the post is in the 'unpublished' category and if is is, simply exits.
  2. Archive pages As you noted - you'll need to exclude these posts from archive pages (category, date and tag). You can do this by customising the query to exclude this category.

If you have a simple theme without multiple templates, this will be reasonably simple but not foolproof since you will still have designated these posts in WP as published!

| improve this answer | |
  • Thanks, I have found code to exclude (via functions.php) which works, at least it does not show on any archive page anymore. Will know soon if this really solves the issue, but I think there is not much more we can do about it since we aren't using the WP publish / unpublish functionalities. – Marcel Mar 27 '17 at 14:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.