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

On a custom post type, I want to remove the filters that show up on /edit.php (where all of the posts are listed out).

I have a custom taxonomy that shows up as a filter that I WANT to keep, but I want to REMOVE the 'Show all dates' and 'View all categories' filters.

Any ideas?

share|improve this question
up vote 3 down vote accepted

This is a very similar question to the one you posted here: How to HIDE everything in PUBLISH metabox except Move to Trash & PUBLISH button Please check my answer. You would simply need to add the IDs of the elements you wish to hide.

You can traverse the DOM to target the elements you need:

#posts-filter .tablenav select[name=m],
#posts-filter .tablenav select[name=cat],
#posts-filter .tablenav #post-query-submit{
share|improve this answer
Brian, the code from the other post works when this is added: add_action('admin_head-edit.php', 'hide_publishing_actions'); But, I am not able to get the Show All Dates removed because it does not have an ID or Class assigned to it. Any ideas? – katemerart Dec 11 '11 at 4:18
Check out my latest edit. – Brian Fegter Dec 11 '11 at 4:35
PERFECT!! Thanks again :) – katemerart Dec 11 '11 at 4:45

There is a filter for the dropdown dates since WP 3.7.0 (sorry I did not check the others but I assume they also have filters).

The filter is: months_dropdown_results

This example below removed the dates dropdown from the admin pages filter but not for posts.

function remove_date_drop(){

$screen = get_current_screen();

    if ( 'page' == $screen->post_type ){
        add_filter('months_dropdown_results', '__return_empty_array');

add_action('admin_head', 'remove_date_drop');
share|improve this answer

Hiding by css also affect other post/page types. At least I was able to remove Actions for an specific cpt using this hook

add_filter('bulk_actions-edit-mycpt', '__return_empty_array');

share|improve this answer

protected by kaiser Sep 29 '14 at 23:23

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

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