Remove All, Published and Trashed Post Views from WordPress

add_action( 'views_edit-post', 'child_remove_some_post_views' );
 * Remove All, Published and Trashed posts views.
 * Requires WP 3.1+.
 * @param array $views
 * @return array 
function child_remove_some_post_views( $views ) {
	return $views;

Similar views can be edited by hooking into 'views_' . $screen->id where $screen is the global $current_screen (or get_current_screen()). Draft, Pending, Mine and Sticky could all be removed in a similar manner.

About Gary Jones

Gary Jones is a UK-based WordPress Engineer, code consultant, and father of extremely premature twins. Driven by a passion for excellence, he creates elegant WordPress plugins and theme solutions for clients, and provides services, including code audits, for other designers and developers.

Gary is a key contributor to the Genesis Framework and has contributed to all except one major branch of WordPress Core since 3.3. He has contributed to many open source projects in the community, and is a co-host on the UK Genesis podcast.

A former teacher in schools and prisons, Gary's goal is to educate WordPress professionals on how they can improve their code. His motto is knowledge is power.


  1. justin says:

    can you remove on the post count and not the name itself? If so how would i go about doing that?

  2. eugene says:

    Hi Gary, can we remove those views in Custom Post Type edit screen ? I’ve tried with that but failed…

  3. eugene says:

    something like this, but it did not work :

    if( get_post_type() === ‘movie’ ) {

    return $views;

  4. I suspect you could leave my demo function the same, but change the hook it is applied to – instead of views_edit-post, try views_edit-movie for instance.

  5. eugene says:

    Thanks for your quick reply! It woks like a charm, yesss

Speak Your Mind