Filter posts by author in WordPress admin area

Maybe you have already read the post about custom taxonomy filter on my blog. And now I will show you how to create the same filter by the authors.

The filter will work not only for posts but also for pages and custom post types.

Here it is:

How to filter all posts by authors in WP administration area.

This code is for your current theme functions.php file:

function rudr_filter_by_the_author() {
	$params = array(
		'name' => 'author', // this is the "name" attribute for filter <select>
		'show_option_all' => 'All authors' // label for all authors (display posts without filter)
	if ( isset($_GET['user']) )
		$params['selected'] = $_GET['user']; // choose selected user by $_GET variable
	wp_dropdown_users( $params ); // print the ready author list
add_action('restrict_manage_posts', 'rudr_filter_by_the_author');

Related Posts

Misha Rudrastyh

Misha Rudrastyh

I love WordPress, WooCommerce and Gutenberg so much. 11 yrs of experience.

Need some custom developer help? Get in touch