Admin & Dashboard PHP Intermediate

Filter the Posts List by Author

Add an "All authors" dropdown next to the category filter on the Posts screen.

Tested on WordPress 7.1 PHP 8.3 No plugin needed Updated
functions.php 12 lines
add_action( 'restrict_manage_posts', function ( string $post_type ): void {
	if ( ! post_type_supports( $post_type, 'author' ) ) {
		return;
	}
	wp_dropdown_users( [
		'name'            => 'author',
		'show_option_all' => 'All authors',
		'selected'        => absint( $_GET['author'] ?? 0 ),
		'capability'      => [ 'edit_posts' ],
		'orderby'         => 'display_name',
	] );
} );

Where to add this

Recommended A code snippets plugin Survives theme changes and is easy to switch off.
Child theme At the end of your child theme's functions.php file.
Must-use plugin As a .php file in wp-content/mu-plugins, starting with <?php.

Always add PHP to a staging site first, or have FTP or file manager access ready, so you can undo it if something goes wrong.

On multi-author blogs, finding one person’s drafts means clicking their name on a post first. This snippet adds a dropdown so you can filter by author directly.

How it works

restrict_manage_posts runs above the posts list, where the date and category filters live. For any post type that supports authors, it adds a dropdown of users who can edit posts.

The dropdown is named author, which is a query variable WordPress already understands. Choosing someone and clicking Filter shows only their posts, with no extra query code.

Things to watch

  • The list includes everyone who can edit posts. On sites with many users, that list can be long.
  • It works for custom post types that support authors too.

How to test it

Go to Posts → All Posts, choose an author and click Filter.

This website uses cookies to enhance your browsing experience and ensure the site functions properly. By continuing to use this site, you acknowledge and accept our use of cookies.

Accept All Accept Required Only