# Remove the Months Filter From Admin Lists

> Drops the "All dates" dropdown from post and media lists, saving a slow query on sites with many thousands of posts or files.

- Type: PHP
- Runs: Admin only
- Category: [Performance](https://wpide.com/library/category/performance/)
- Tags: performance, admin, database
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/remove-admin-months-dropdown/

## Code

```php
add_filter( 'disable_months_dropdown', '__return_true' );

// The media library runs the same kind of query for its date filter.
add_filter( 'media_library_months_with_files', '__return_empty_array' );
```

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Remove the Months Filter From Admin Lists" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
