When we work with WordPress websites, the backend admin menu is an important part of an administrator's daily operations. However, the default admin menu may not fully meet everyone's needs. In this article, we will introduce two methods in detail:Manage menus using plugins and manual reordering via code.
![Image[1]-Detailed Guide: How to Customize and Reorder WordPress Admin Menu via Plugin or Code - Photon Fluctuation Network | Professional WordPress Repair Service, Global Reach, Fast Response](https://www.361sale.com/wp-content/uploads/2024/09/2024092811592974.png)
Reordering the Admin Menu with Plugins
Using the plugin requires no coding, is easy to do and the visualization is intuitive. The following steps will help you understand how to reorder the menu using the plugin.
Step 1: Install the plug-in
We will use the Admin Menu Editor plug-in (software component)
![Image[2]-Detailed Guide: How to Customize and Reorder WordPress Admin Menu via Plugin or Code - Photon Fluctuation Network | Professional WordPress Repair Service, Global Reach, Fast Response](https://www.361sale.com/wp-content/uploads/2024/09/2024092811470183.png)
The plugin allows drag and drop reordering of admin menus. It also provides some additional features such as editing menu names, changing access rights, etc.
- Go to the plugin directory: Log in to your WordPress dashboard and navigate to Plugins > Add New PluginThe
- Search plugin: In the search bar type "Admin Menu Editor" and find the plugin, click InstallationThe
- Activate the plug-in: After the installation is complete, click activateThe
Step 2: Reordering the menu using the plugin
- Open the menu editor: After activating the plugin, go to Settings > Menu EditorThe
![Image[3]-Detailed Guide: How to Customize and Reorder WordPress Admin Menu via Plugin or Code - Photon Fluctuation Network | Professional WordPress Repair Service, Worldwide, Fast Response](https://www.361sale.com/wp-content/uploads/2024/09/2024092811484338.png)
- Drag and drop menu items: In the Menu Editor screen, you can see the current management menu. With a simple drag-and-drop operation, you can rearrange the menu items according to your needs.
![Image[4]-Detailed Guide: How to Customize and Reorder WordPress Admin Menu via Plugin or Code - Photon Fluctuation Network | Professional WordPress Repair Service, Worldwide, Fast Response](https://www.361sale.com/wp-content/uploads/2024/09/2024092811494351.png)
- Customize menu settings: Clicking on each menu item allows you to adjust their settings, such as changing the menu name, setting user permissions, and so on.
![Image[5]-Detailed Guide: How to Customize and Reorder WordPress Admin Menu via Plugin or Code - Photon Fluctuation Network | Professional WordPress Repair Service, Global Reach, Fast Response](https://www.361sale.com/wp-content/uploads/2024/09/2024092811502240.png)
- Save changes: Once you have completed the adjustments, click on the bottom of the page Save Changes button and your customized menu will take effect.
Plug-in Functionality Advantages
- Intuitive operation: Drag-and-drop interface, easy to use.
- Fine customization options: Customizable menu names, icons, links and even permissions.
- Reduce the risk of errors: The plugin automatically handles code sections to avoid user errors due to manual coding.
Manually reorder the admin menu by code
If you don't want to do this through a plugin, or if you want to control the WordPress backend more precisely, you can do so by editing the theme's functions.php file to achieve manual sorting. This method requires some basic coding knowledge, but avoids resource consumption and performance issues caused by plugin installation.
Step 1: Visit functions.php
- Go to the theme editor: Log in to the WordPress backend and navigate to Appearance > Theme File EditorThe
- show (a ticket)
functions.phpDocumentation: In the list of theme files on the right hand side find and click on thefunctions.phpDocumentation.
![Image[6]-Detailed Guide: How to Customize and Reorder WordPress Admin Menu via Plugin or Code - Photon Fluctuation Network | Professional WordPress Repair Service, Worldwide, Fast Response](https://www.361sale.com/wp-content/uploads/2024/09/2024092811513352.png)
Step 2: Add Custom Code
exist functions.php At the end of the file, add the following code snippet:
add_filter('custom_menu_order', 'custom_reorder_admin_menu');
add_filter('menu_order', 'custom_reorder_admin_menu');
function custom_reorder_admin_menu($menu_ord) {
if (!$menu_ord) return true;
return array(
'index.php', // Dashboard
'separator1', // separator
'edit.php?post_type=page', // Pages
'edit.php', // Posts
);
}
code interpretation
add_filter('custom_menu_order', 'custom_reorder_admin_menu');: This code tells WordPress that you want to customize the order of the admin menu.add_filter('menu_order', 'custom_reorder_admin_menu');: Bymenu_orderHooks set custom order.$menu_ordArray: This array contains the current menu items. The order of each menu item can be specified by returning a new array.
How to further customize the menu
![Image [7]-Detailed Guide: How to Customize and Reorder WordPress Admin Menu via Plugin or Code - Photon Fluctuation Network | Professional WordPress Repair Service, Worldwide, Fast Response](https://www.361sale.com/wp-content/uploads/2024/09/2024092811572984.png)
Menu items in the code can be adjusted as needed. For example, if you want theRemove a menu item (e.g., the Articles menu), the following code can be used:
function remove_posts_menu($menu_ord) {
if (($key = array_search('edit.php', $menu_ord)) !== false) {
unset($menu_ord[$key]);
}
return $menu_ord;
}
add_filter('menu_order', 'remove_posts_menu');
This code will remove the "Articles" item from the admin menu.
How to Fully Customize WordPress Admin Menu
In addition to reordering the menu items, you can further customize the WordPress backend admin menu in the following ways.
Deleting menu items
By using the remove_menu_page() function, you can completely hide some unwanted menu items. The sample code is as follows:
phpCopy codefunction remove_menus() {
remove_menu_page('edit-comments.php'); // Remove the Comments menu item
remove_menu_page('upload.php'); // Delete Media Library menu item
}
add_action('admin_menu', 'remove_menus');
By calling the remove_menu_page(), you can hide multiple menu items.
Fully customizable user interface
On top of managing menu items, it is also possible to combine user roles and permissions to display different menu items for different users. This can be accomplished through the current_user_can() function to ensure that only users with specific permissions can access certain menus.
summarize
Customizing the WordPress backend admin menu can help you improve your website's management efficiency, whether you use a plugin or manually add code. Plugins are suitable for beginners, with simple drag-and-drop operation and low risk, while the code approach is suitable for advanced users and can provide a more flexible customization experience.
![Image[8]-Detailed Guide: How to Customize and Reorder WordPress Admin Menu via Plugin or Code - Photon Fluctuation Network | Professional WordPress Repair Service, Worldwide, Fast Response](https://www.361sale.com/wp-content/uploads/2024/09/2024091303290152.jpg)
draw attention to sth.
- Backup website: in editorial
functions.phpBe sure to back up your site before you file, in case of unexpected errors. - Test Changes: After making any changes, make sure to test the operation of the WordPress backend to confirm that the menus are working as expected.
With these methods, it's easy to customize and optimize the WordPress backend admin menu to better fit your workflow needs.
Link to this article:https://www.361sale.com/en/20891The article is copyrighted and must be reproduced with attribution.





















![Emoji[wozuimei]-Photonflux.com | Professional WordPress repair service, worldwide, rapid response](https://www.361sale.com/wp-content/themes/zibll/img/smilies/wozuimei.gif)
![Emoticon[baoquan] - Photon Wave Network | Professional WordPress Repair Services, Worldwide Coverage, Rapid Response](https://www.361sale.com/wp-content/themes/zibll/img/smilies/baoquan.gif)

No comments