How to display by default only published posts/pages in the admin area?

I’m not sure if there’s another way, but manipulating the global variable $submenu can make this work.

The following is just a manual hack (I’m not aware of any hook) and may fail on non-standard submenus set ups. The regular Post post type has a unique address and the rest of types has another one, hence two foreachs.

add_action( 'admin_menu', 'default_published_wpse_91299' );

function default_published_wpse_91299() 
{
    global $submenu;

    // POSTS
    foreach( $submenu['edit.php'] as $key => $value )
    {
        if( in_array( 'edit.php', $value ) )
        {
            $submenu['edit.php'][ $key ][2] = 'edit.php?post_status=publish&post_type=post';
        }
    }

    // OTHER POST TYPES
    $cpt = array( 'page', 'portfolio' ); // <--- remove or adapt the portfolio post type
    foreach( $cpt as $pt )
    {
        foreach( $submenu[ 'edit.php?post_type=" . $pt ] as $key => $value )
        {
            if( in_array( "edit.php?post_type=" . $pt, $value ) )
            {
                $submenu[ "edit.php?post_type=".$pt ][ $key ][2] = "edit.php?post_status=publish&post_type=" . $pt;
            }
        }   
    }
}

Leave a Comment