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

How can I hide all posts from a single category and not show them in the posts admin screen.

share|improve this question
How do you try that? Show us your code please. – toscho Oct 1 '12 at 17:28
Got it! Answer below! – Lucas Veiga Oct 1 '12 at 17:53
function posts_for_current_author($query) {
global $pagenow;

if( 'edit.php' != $pagenow || !$query->is_admin )
return $query;

else {
    $query->set('cat', "-11");
return $query;
share|improve this answer
Something is missing. A filter registration maybe? :) – toscho Oct 1 '12 at 17:58

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.