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

I was looking at the method below to reorder the Admin Menu Sections:


...and was wondering if it's possible to reorder the submenu sections using similar method.

share|improve this question
up vote 4 down vote accepted

Yes there is, but I cannot find a simpler way...

Here, we are changing the Media submenu and inverting Add new and Library.

add_filter( 'custom_menu_order', 'wpse_73006_submenu_order' );

function wpse_73006_submenu_order( $menu_ord ) 
    global $submenu;

    // Enable the next line to inspect the $submenu values
    // echo '<pre>'.print_r($submenu,true).'</pre>';

    $arr = array();
    $arr[] = $submenu['upload.php'][10];
    $arr[] = $submenu['upload.php'][5];
    $submenu['upload.php'] = $arr;

    return $menu_ord;
share|improve this answer

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.