Have you ever wanted to rearrange the tabs in your WordPress admin menu to better suit your workflow? Maybe you find yourself frequently navigating to a specific section and wish it was more easily accessible. With a few simple steps, you can customize the order of your WordPress menu tabs to your liking.
In this guide, we’ll walk you through the process of reordering the tabs in your WordPress admin menu using a custom function in your theme’s functions.php file.
Step 1: Access Your Theme’s functions.php File
First, you’ll need to access your theme’s functions.php file. You can do this by logging in to your WordPress dashboard, navigating to Appearance > Theme Editor, and selecting the functions.php file from the list of theme files on the right-hand side.
Step 2: Add the Custom WordPress Admin Menu Order Function
Next, you’ll need to add the following custom function to your functions.php file:
function custom_menu_order($menu_ord) {
if (!$menu_ord) return true;
return array(
'index.php',
'separator1',
'edit.php?post_type=page',
'edit.php',
);
}
add_filter('custom_menu_order', 'custom_menu_order');
add_filter('menu_order', 'custom_menu_order');
Step 3: Customize the Menu Order
In the custom_menu_order function, you can customize the order of the tabs by adding or removing items from the array. Each item corresponds to a specific tab in the admin menu. For example, ‘index.php’ represents the Dashboard tab, ‘edit.php?post_type=page’ represents the Pages tab, and ‘edit.php’ represents the Posts tab.
You can find the slug for other tabs in the admin menu by inspecting the links in your browser’s developer tools while on the corresponding admin page.
Step 4: Save Your Changes
Once you’ve customized the menu order to your liking, save your changes to the functions.php file.
Step 5: Refresh Your WordPress Admin
Finally, refresh your WordPress admin dashboard to see the changes reflected in the admin menu. Your tabs should now be reordered according to your custom menu order function.
By following these steps, you can easily customize the order of tabs in your WordPress admin menu to better suit your needs and improve your workflow.