Detailed Guide: How to Customize and Reorder WordPress Admin Menu via Plugin or Code

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

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

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.

  1. Go to the plugin directory: Log in to your WordPress dashboard and navigate to Plugins > Add New PluginThe
  2. Search plugin: In the search bar type "Admin Menu Editor" and find the plugin, click InstallationThe
  3. Activate the plug-in: After the installation is complete, click activateThe

Step 2: Reordering the menu using the plugin

  1. 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
  1. 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
  1. 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
  1. 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

  1. Go to the theme editor: Log in to the WordPress backend and navigate to Appearance > Theme File EditorThe
  2. show (a ticket) functions.php Documentation: In the list of theme files on the right hand side find and click on the functions.php Documentation.
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

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');: By menu_order Hooks set custom order.
  • $menu_ord Array: 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

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

draw attention to sth.

  1. Backup website: in editorial functions.php Be sure to back up your site before you file, in case of unexpected errors.
  2. 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.


Contact Us
Can't read the tutorial? Contact us for a free answer! Free help for personal, small business sites!
Customer Service
Customer Service
Tel: 020-2206-9892
QQ咨询:1025174874
(iii) E-mail: info@361sale.com
Working hours: Monday to Friday, 9:30-18:30, holidays off
© Reprint statement
Author: xiesong
THE END
If you like it, support it.
kudos0 share (joys, benefits, privileges etc) with others
commentaries sofa-buying

Please log in to post a comment

    No comments