WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

I want to be able to customize the WordPress edit posts screen to filter based on a custom field (or whatever).

Unfortunately I'm not sure what filter or hook to use here, and instead of opening the code myself, figured I'd throw the question out here.

Just to be clear, I'm talking about this screen. Essentially I want to be able to add a new "tab" next to Drafts, Pending, etc.

enter image description here

Update After testing this, here's the solution:

add_filter( 'parse_query', 'filter_post_edit_screen' );
function filter_post_edit_screen($query) {
  global $pagenow;

  if (is_admin() && $pagenow=='edit.php'){
        $query->query_vars['category__not_in'] = array(120,9999);
  return $query;

That's it. Just paste that into a plugin. Obviously you'd tweak the category IDs or add some more substantial code.

share|improve this question
up vote 4 down vote accepted

You need a to use a few hooks for that

take a look at mike's answer to a similar question.

Hope this Helps

share|improve this answer
Interesting, that looks like the right answer. I'll test, but I'll mark it correct now. =) – The How-To Geek Feb 15 '11 at 1:52

I found a plugin that might be a solution to your problem: http://wordpress.org/extend/plugins/extended-admin-post-filter/installation/
If that doesn't work then I think the only way out is to edit the WP core files (not recommended though) for the Edit Posts View & add a tab which filters posts according to the category or tag. This should work for sure! :)

share|improve this answer
Actually I already tested that plugin - it doesn't actually use any hooks, just adds the extra fields in there as drop-downs, since you can already filter with the query string by clicking on a tag or author name. – The How-To Geek Feb 15 '11 at 1:46

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.