WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Let's say I have a category named "Hidden". I'd like to prevent all posts in "Hidden" from appearing within The Loop on the main blog listing page.

Also, I'd like to prevent those posts from appearing anywhere else (category listing pages, archives, etc.)

However, I'd still like the posts to be accessible via their permalink. Is this possible?

Thanks! :)

share|improve this question
up vote 0 down vote accepted

Answering my own question here:

Is it really as easy as including this within a pre_get_posts filter?

$query->set('category__not_in', $term_id);
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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