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! :)

1 Answer 1


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);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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