WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In my testing environment, I've got one hundred plugins. I'm more interested in seeing first the Active plugins than the complete list (All).

How can I change the default screen for the Plugins menu item?

enter image description here

share|improve this question
| Active Elsewhere. – brasofilo Apr 15 '13 at 11:41
up vote 2 down vote accepted

There are two options, modify the menu link href attribute or redirect the main screen.

Modify menu

Alter the global variable $submenu. This method works for Single and Multisite.
Problem: the submenu item Installed Plugins doesn't show in bold.

add_action( 'admin_head', 'b5f_plugins_redirect_to_active' );

function b5f_plugins_redirect_to_active() 
    global $submenu;
    $submenu['plugins.php'][5][2] .= "?plugin_status=active";

Redirect page

Hook into load-plugins.php. Multisite detection is needed, but there are no UI problems.

add_action( 'load-plugins.php', 'b5f_ms_plugins_redirect_to_active' );

function b5f_ms_plugins_redirect_to_active() 
    // Trick, plugin_status is only false in WP default screen
    // ['action'] prevents us interfering with activation/deactivation 
    if( isset( $_GET['plugin_status'] ) || isset( $_GET['action'] ) )

    // Check for MS dashboard, redirect accordingly
    if( is_network_admin() )
        wp_redirect( network_admin_url( 'plugins.php?plugin_status=active' ) );
        wp_redirect( admin_url( 'plugins.php?plugin_status=active' ) );


And a couple of extras:

1) Rename the main link to Active

add_action( 'admin_menu', 'rename_submenu_item', 99 );

function rename_submenu_item() 
    global $submenu;
    foreach( $submenu['plugins.php'] as $key => $value )
        if( in_array( 'activate_plugins', $value ) ) 
            $submenu['plugins.php'][$key][0] = __( 'Active' );

2) Add a submenu to access All

The submenu link is hacked, as well as some jQuery printed to fix the submenus active state:

add_action( 'admin_menu', 'menu_admin_wpse_44270' );
add_action( 'admin_head-plugins.php', 'highlight_menu_item_wpse_44270' );

function menu_admin_wpse_44270() 
        '<span id="my-all-plugins">All</span>', 

function highlight_menu_item_wpse_44270()
    if( isset( $_GET['plugin_status'] ) && 'all' == $_GET['plugin_status'] )
        <script type="text/javascript">
            jQuery(document).ready( function($) 
                var reference = $('#my-all-plugins').parent().parent();
                // add highlighting to our custom submenu
                //remove higlighting from the default menu
share|improve this answer
Same technique for themes with load-theme-install.php, $_GET['tab'] and theme-install.php?tab=install. – brasofilo Jul 13 '13 at 17:03

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.