I can’t seem to figure out how to change the default view for “Pages” in the admin menu.

The initial view is the “Pages” view (/wp-admin/edit.php?post_type=page)

How could it change this to something else?
Like “Add New Page”? (/wp-admin/post-new.php?post_type=page)

I’ve tried several different options including rebuilding the menu with a custom menu, but it seems like WordPress automatically keeps redirecting the “Pages” view (/wp-admin/edit.php?post_type=page).

3 Answers
3

[Update]
Answer rewritten, based on this other Q&A.


To achieve this:

default pages menu view

Use this code:

add_filter( 'custom_menu_order', 'wpse_48933_submenu_order' );

function wpse_48933_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['edit.php?post_type=page'][10];
    $arr[] = $submenu['edit.php?post_type=page'][5];
    $submenu['edit.php?post_type=page'] = $arr;

    return $menu_ord;
}

Leave a Reply

Your email address will not be published. Required fields are marked *