Changing Pages Positions in WP Admin Panel

Can i change the default postion of pages and media in my wordpress admin dashboard.

Yes, you can absolutely change the default position of Pages, Media, or any other admin menu items in the WordPress dashboard! You can do this programmatically by removing and re-adding the menu items in the order you want, or using menu position numbers.


function wpio_custom_menu_order($menu_ord) {
    if (!$menu_ord) return true;

    return array(
        'index.php',                // Dashboard (stays at 1)
        'edit.php?post_type=page', // Pages (2)
         'edit.php',                // Posts (3)
        'upload.php',              // Media (4)
        /*Add custom post types or others below as needed:
        'edit.php?post_type=wpio-artwork',
        'edit.php?post_type=wpio-book',
        'edit.php?post_type=wpio-movie',*/
    );
}
add_filter('custom_menu_order', '__return_true');
add_filter('menu_order', 'wpio_custom_menu_order');

🔧 Method 1: Change Menu Order via menu_order Filter

This gives you full control over the admin menu order, including Pages, Media, CPTs, and more.

phpCopyEditfunction custom_menu_order($menu_ord) {
    if (!$menu_ord) return true;

    return array(
        'index.php',                // Dashboard
        'upload.php',              // Media
        'edit.php?post_type=page', // Pages
        'edit.php',                // Posts
        'separator1',              // Separator
        'edit.php?post_type=book', // Your CPT
        'themes.php',              // Appearance
        'plugins.php',             // Plugins
        'users.php',               // Users
        'tools.php',               // Tools
        'options-general.php',     // Settings
    );
}
add_filter('custom_menu_order', '__return_true');
add_filter('menu_order', 'custom_menu_order');

📝 Tips:

  • The values must match the menu slugs.
  • You can inspect them by hovering over the menu items and checking the URL (edit.php?post_type=page for Pages, etc).

📍 Method 2: Use menu_position in CPTs

If you’re registering Custom Post Types (like Books, Movies), you can set menu_position like this:

phpCopyEdit'menu_position' => 5, // Below Posts

Reference positions:

PositionMenu Item
2Dashboard
4Separator
5Posts
10Media