In WordPress, the admin menu is essential for managing plugins, settings, themes, and other site features.
However, sometimes the default arrangement doesn’t suit a site’s needs, and you may want to move submenu items to better organize the admin interface.
For example, you might want to move a submenu item from one parent menu to another for quicker access or to declutter specific areas.
This guide shows you how to relocate a submenu item in the WordPress admin menu using custom code.
Why Rearrange Submenu Items in the WordPress Admin Menu?
Moving a submenu item to a different parent can help streamline your workflow, making it easier to navigate and manage your website.
For instance, if a plugin’s submenu item is buried under “Settings,” but you access it frequently, moving it to a more prominent parent, such as “Dashboard” or “Appearance,” can save time.
This reorganization is particularly beneficial for multisite administrators or users who manage several sites from a single dashboard.
Steps to Move a Submenu Item in the WordPress Admin Menu
To move a submenu item, we’ll need to use custom code. The following steps will walk you through how to create this functionality using PHP in your WordPress theme’s functions.php
file or a custom plugin.
1. Identify the Submenu Item to Move
Before making any changes, identify the submenu item you want to move. Each menu and submenu in WordPress has a unique slug that WordPress uses to organize and display these items in the admin area. You can find submenu slugs by inspecting the URL of the desired submenu item in the WordPress dashboard.
For example, the submenu slug for “Permalinks” under “Settings” is options-permalink.php
, and the parent menu slug for “Settings” is options-general.php
.
2. Use remove_submenu_page()
to Remove the Original Submenu
To move a submenu item, you must first remove it from its current location. This is done with the remove_submenu_page()
function, which removes the item from its original parent menu.
Add the following code to your theme’s functions.php
file or a custom plugin file: