Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

1 Answer 1

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

 
discard

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.