To remove the dates:
function my_remove_date_filter( $months ) {
global $typenow; // use this to restrict it to a particular post type
if ( $typenow == 'post' ) {
return array(); // return an empty array
}
return $months; // otherwise return the original for other post types
}
add_filter('months_dropdown_results', 'my_remove_date_filter');
To remove categories:
function my_remove_cat_filter( $output ) {
global $typenow;
if ( is_admin() && $typenow == 'post' ) {
return ''; // return a blank string
}
return $output;
}
add_filter('wp_dropdown_cats', 'my_remove_cat_filter');
Related Posts:
- Row actions for custom post types?
- How can I remove the “Add New” button in my custom post type?
- How do I filter the excerpt metabox description in admin?
- Hide/Show only specific categories in wp-admin new-post.php
- Best way to filter featured image text for a custom post type?
- WP Admin default view mode for Custom Post Type
- Filter get_categories() for taxonomy term in WordPress
- Restrict categories to a custom post type
- Remove “Get Shortlink” button in admin of custom post type
- Filter categories of posts with checkboxes
- How to detect filter in URL in Category page?
- Categories of custom taxonomy don’t show any posts
- Filter term taxonomy metabox in custom post type
- Filter hierarchical custom post type admin page by parent, and include children & grandchildren
- Loop filtering Custom Post Types and/or Categories
- Categories filtering in new post
- Create new custom post and post category of same name
- WP Admin Dropdown List Filter for custom (ACF) field on custom post type(s)
- Add filter button to custom post type in admin area
- Dropdown switching subcategories portfolio
- Filter wp_dropdown_categories Per Post Type
- How to filter posts by categories?
- Can WordPress show posts based on a button that the user clicked 2 pages back?
- Change CPT Edit Target Link for Admin List
- Exclude a category from WP_Query
- How to display regular posts & custom post types that fall under a category using just the generic category template?
- How can I filter posts by post_parent in the admin?
- How do I Filter Custom Post Type by Custom Taxonomy in the newest WordPress RESTful API?
- Is it OK to move admin menu items?
- How to filter custom post types by custom category taxonomy
- WordPress Custom Post Type Admin Page really slow
- How to list all categories and tags in a page?
- Filter by custom Field for Custom post type Admin Listing
- Post slug changed using code doesn’t reflect on editor when post is published
- Pagination not working with custom category template
- Remove wpautop from all posts/pages except my custom post type
- remove support for ‘Categories’ for a custom post type
- Make the ‘all’ filter default instead of ‘mine’ in a custom post type
- How to programatically set the post title of a CPT on wp-admin
- Structuring a product catalogue in WordPress [closed]
- WP_Query with custom post_type and cat retrieving unwanted posts with the custom posts
- What is better: Custom Fields vs Custom Taxonomies with Terms for perfomance, scalability and better user experience
- get_terms won’t display product_cat or any other custom taxonomies when specified
- Add $more_link_text parameter to the_excerpt()
- Show Custom Post Type values in WordPress grid view
- Showing Custom Content in a Nav Dropdown
- Show Post Count of a Category
- Combining custom post type and post category
- Change headers in admin posts list
- Remove rows in the manage post/page view
- How to change post featured image using a custom field of category?
- Setting proper query for multiple custom admin filters
- Display all posts in main category and 1 subcategory
- Show category ID on custom post type
- How can I see a list of my Custom Post Types of the last term I was in?
- How to call in Custom Post-Type Categories?
- get_category_parents for custom post type taxonomy
- Custom post type getting wrong categories and tags
- How to filter wp_list_categories output with some custom post type meta query?
- creat filter with wp_query
- How to display “Category and Post_tag” component in a CPT Gutenberg edit screen?
- Custom post type editor with dynamic selects, one drop down populating a second second drop down not working
- Custom Post Type and Category Base Rewrite Issue
- WP-ADMIN – Listing all CPT in “posts” listing
- Custom post type and category link together
- WP the_posts() on single-cars.php get category link
- Filter posts by tax (dropdown) and meta value
- Displaying Custom Posts
- How to include category name/id in wp_query for retrieving “custom post type” from a particular category?
- Include custom post type custom taxonomies in Categories widget
- WordPress custom post categories and subcategories on category.php
- Custom capabilities not reflecting on admin panel
- Use post in multiple places on a page with multiple posts
- Can’t pull posts of a Custom Post Type based on the custom taxonomy of the CPT
- Change Post Meta via AJAX from the posts list table
- Catch and display error on save_post action
- Custom Attachment Type
- Custom post type specific category box
- Custom Taxonomy Taxonomies of Same Name point to first created URL
- Is possible register two archive pages for single custom post type?
- Custom Permalink For Custom Post Type – Working Fine But Broken For Pagination
- Set a Default CPT taxonomy by taxonomy id
- Automatic Set Category For A Custom Post Type
- how to create custom taxonomy drop downs for parents and child
- How to redirect from wp-admin/edit.php to a frontend page for specific custom post type?
- Only show categories that have posts within custom post type
- Custom post meta box as a sub form
- How to create groups like that in buddypress?
- Getting list of Categories for Custom Post Types
- Adding Information To All Posts Screen
- Custom Post Type + Category archive
- Exclude categories For Custom post types
- Show custom post type in archive page by category
- I have a custom post type that I want to query a dynamic category name from a custom meta field
- Displaying wp post categories into my custom metabox
- Show posts of parent in edit.php
- WordPress custom post type post and category links 404
- One set of categories for multiple custom posts
- Choose custom post type template by category
- Are custom posts included when getting a categories’ posts?