By default, WordPress arranges the menu items in a specific sequence, starting with the Dashboard, followed by Posts, Media, Pages, and Comments. However, you might want to move items up and down to match the way you use them daily.
With a simple code snippet, you can customize the order of the admin menu in WordPress. Copy the code given below and paste this code into your child theme’s functions.php file, or use a plugin like ‘Code Snippets’.
add_filter('custom_menu_order', function() { return true; }); add_filter('menu_order', 'ts_new_admin_menu_order'); /** * Filters WordPress' default menu order */ function ts_new_admin_menu_order( $menu_order ) { // define your new desired menu positions here // for example, move 'upload.php' to position #9 and built-in pages to position #1 $new_positions = array( 'index.php' => 1, // Dashboard 'edit.php' => 4, // Posts 'upload.php' => 3, // Media 'edit.php?post_type=page' => 5, // Pages 'edit-comments.php' => 2 // Comments ); // helper function to move an element inside an array function move_element(&$array, $a, $b) { $out = array_splice($array, $a, 1); array_splice($array, $b, 0, $out); } // traverse through the new positions and move // the items if found in the original menu_positions foreach( $new_positions as $value => $new_index ) { if( $current_index = array_search( $value, $menu_order ) ) { move_element($menu_order, $current_index, $new_index); } } return $menu_order; };