# Reorder the Admin Menu

> Puts the admin menu items you use most at the top, in the order you choose. Everything else keeps its place below.

- Type: PHP
- Runs: Admin only
- Category: [Admin](https://wpide.com/library/category/admin/)
- Tags: admin, menu, order
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/reorder-admin-menu/

## Code

```php
// Menu slugs in the order you want them at the top of the menu.
$wpide_menu_order = array(
    'index.php',
    'separator1',
    'edit.php?post_type=page',
    'edit.php',
    'upload.php',
);

add_filter( 'custom_menu_order', '__return_true' );

add_filter( 'menu_order', function ( $order ) use ( $wpide_menu_order ) {
    if ( ! is_array( $order ) ) {
        return $order;
    }

    $first = array_values( array_intersect( $wpide_menu_order, $order ) );

    return array_merge( $first, array_values( array_diff( $order, $first ) ) );
} );
```

## Notes

Find a slug by hovering a menu item: it is the part of the link after /wp-admin/.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Reorder the Admin Menu" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
