WordPress: Custom Admin Submenu Order

It is possible to change the submenu order of the admin menus. In particular we are using the custom_menu_order WordPress filter to manipulate the global $submenu array. In order to find out the specific submenu identifier we have to display the whole array and choose the necessary entry. For example if we want to adjust the submenu of the plugins menu to display the “Install” link first. We need to move array index [10] to [1]. To avoid displaying the submenu entry as duplicate we also have to remove the old index. Finally we have to sort the array to apply the changes.

The following example and code will sort the “plugins” menu to move the Install link to the top of the submenu. Take it and fit it to your needs to re-order any specific admin submenu: