Admin Menu Editor For WordPress

Admin Menu Editor is a WordPress plugin that will let you manually edit the Dashboard menu. You can reorder the menus, show/hide specific items, change access rights, and more.

Features

  • Sort menu items any way you want by simple drag & drop.
  • Move a menu item to a different submenu via cut & paste.
  • Edit any existing menu – change the title, access rights, menu icon and so on. Note that in the free version you can’t relax menu permissions – i.e. give access rights to a role that originally didn’t have them – but you can change them to be more restrictive.
  • Hide/show any menu or menu item. A hidden menu is invisible to all users, including administrators.
  • Create custom menus that point to any part of the Dashboard. For example, you could create a new menu leading directly to the “Pending comments” page.

Here’s a screenshot :

Admin Menu Editor screenshot

This plugin also has a Pro version that offers a bunch of extra features.

Download

admin-menu-editor.zip

The latest version of the plugin is always available on WordPress.org.

Requirements :

  • WordPress 4.1 or later
  • PHP 5.2 or later

Known Issues

The basic idea for the plugin was suggested by several commenters way back in October. However, the internal menu system that WordPress uses is obscure and unsuitable for direct manipulation, so I spent quite a while inventing workarounds. And even after a few weeks of pondering, there are some things I haven’t quite fixed.

  • If you delete any of the default menus they will reappear after saving. This is not a bug, it’s a feature 😉
  • As I mentioned before, the access rights required for using a particular menu item can’t be lowered, but can be made more strict. This has been fixed in the Pro version.
  • Plugin menus that are moved to a different submenu will not work unless you put the full page URL in the “URL” field. This is because WP “ties” the menu item to it’s parent menu and won’t recognize it in a different submenu.
Related posts :

556 Responses to “Admin Menu Editor For WordPress”

  1. Ross says:

    Apparently the Reflection class wasnt included in my version of PHP. But now it is and everything is working! Great stuff!

  2. Mike says:

    I am back for more. I am trying to add the custom icon to our custom admin page, yes I am a perfectionist, and yes sometimes I wonder if I will ever understand php. I have tried so many different things to no avail. Maybe someday it will click.

    By the way nice post on the mozilla addons. I like the autopager.

  3. White Shadow says:

    Well, the documentation says you can simply add the icon URL as the last parameter when calling add_menu_page, e.g. :

    add_menu_page(
    	'Example Menu', 'Example Menu', 
    	'manage_options', 'example_top_menu', 
    	array(&$this, 'page_example_top_menu'),
    	'your-icon-URL-here'
     );
    

    I imagine you could use a relative URL there, like “/wp-content/plugins/myplugin/icon.png” (though hardcoding the path isn’t always a good idea).

  4. Mike says:

    I tried that approach with /images/icon.png and public_html/images/icon.png

    I then get this error: Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/aquacult/public_html/wp-content/plugins/exchangemenu.php on line 30

    this is officially my code:
    add_menu_page(‘Example Menu’, ‘Jobs Aquatic’, ‘read’,
    ‘example_top_menu’, array(&$this, ‘page_example_top_menu’)’public_html/images/icon.png’);

    You dont have to bother with this as it is not really necessary, but when I try and do something and I cant make it happen it tends to make me want to conquer and defeat the problem.

  5. White Shadow says:

    It looks like you’re missing a comma before the icon URL. And I think you don’t need the “public_html” bit.

  6. Mike says:

    Right on, that reminds me of what I read about php someplace. “Commas and semi-colons can be your worst enemy.”

    Also when I was trying this I was putting the full image url. That is the way a few of the other plugins I use work.

    Anyway thsi is what it should look like:
    add_menu_page(‘Example Menu’, ‘Jobs Aquatic’, ‘read’,
    ‘example_top_menu’, array(&$this, ‘page_example_top_menu’),’/images/icon.png’)

    Thanks for helping out with the custom wordpress admin menu.

  7. scribu says:

    Hello,

    your plugin is very useful, but if I set different access level for a top level menu, the menu is still visible to users who don’t have that capability.

  8. scribu says:

    Here is the function (simplified) which deals with capabilities:

    http://wordpress.pastebin.ca/1389987

    The problem is that it only filters submenus and leaves menus intact.

  9. scribu says:

    Sorry, this is the working version: http://wordpress.pastebin.ca/1389993

  10. White Shadow says:

    I seem to hazily remember that there was some specific reason for not filtering out top-level menus, but I don’t recall what it was. Anyway, if you also set the different access level for the submenus, WP should hide the top-level menu as it will have no visible submenus.

  11. scribu says:

    Ok, I guess that’s a solution.

    BTW, have you considered submitting this plugin to wordpress.org so that we can get automatic updates?

  12. White Shadow says:

    Yes, but I’m very lazy in this respect 😛

  13. Bryan says:

    Anyway to make this work with PHP4?

  14. White Shadow says:

    One could try, but it would take a lot of rewriting.

    You’d need to set all hooks manually – the “magic” self-installing hooks of my makeshift plugin framework depend on the Reflection API, which is PHP5-specific. Class constructions would need to be renamed. Some variable initializers might not work in PHP 4 (arrays?). There’s probably a foreach() loop or two that use the iterator by reference (also not supported in PHP4). And so on.

  15. sbdesign says:

    Thanks for this great plugin! I looked for ages to find something to simplify the administration menus for my clients. Good work!

  16. phpworker says:

    Well, it does just what I need – great plug! Thanks a lot 🙂

  17. Robert Neuschul says:

    First, thanks for what is a really useful plugin.

    Second, the problem [you just knew there had to /be/ a problem :-)]: not sure if this comes about from trying to do too much with ME, or as a result of an interaction with other plugins. It _only_ happens on one site where there are some 20 or so plugins installed [it’s a very complex “private” members-only site]

    Problem Description: open menu editor from Settings menu, go to “settings” sub-menu, sort all plugins [not default WP items] into alphabetical order below the default WP elements. Save. Refresh page. Go to Settings menu: Menu Editor itself has vanished from the Settings menu and one or more other plugins may also have vanished, whilst one or more plugins may be duplicated in the Settings at odd non-alphabetical places in that settings menu. Duplicate items _are_ functional.

    Go back to Menu Editor via the installed plugins page or via direct URL and ME shows everything correctly as last saved: not as shown on the settings menu.

    Clearing the WP Cache makes no difference. Clearing the browser cache makes no difference. Indeed the problem is visible from different machines on different OSs and using several different browsers etc etc.

    Reset menus to default order, save and refresh and everything instantly works as expected.

    Have tried deactivating Menu Editor, cleaning out the options table and then reactivating, but the problem reappears fairly quickly once one starts sorting entries.
    I’ve not yet had the courage to deactivate all other plugins and/or reset the WP options table to defaults in order to do a ‘clean’ test because this is such a complex site.

    NB: this problem does _not_ arise on other less complex sites running on the same configuration of Apache/Linux with PHP5.n and MySQL5.n and WP 2.7.1 [they’re all virtual hosts on the same physical box], although many of them do share several of the same plugins.

    Having to run with default order in the Settings menu isn’t a major issue, but missing and/or duplicate items could become a problem. Most of all it’s an irritant which is puzzling me.

    Any thoughts or suggestions?

  18. White Shadow says:

    Yep, this might really be a compatibility issue. So muster up the courage and test that idea 🙂 – First, save the sorted configuration. Then deactivate/reactivate your other plugins one by one. Reload the page aftear each deactivated plugin and see if the menu is OK. That should help you find the conflicting one.

    Personally, I’m pretty sure it is a plugin conflict. Sorting works fine even in WP 2.8 beta, though there are some glitches with separators.

  19. Gianfranco says:

    Hi, with the purpose to check plugin compatibility behaviour with 2.0, I duplicated my WordPress site and upgraded. Strangely all my settings in the Menu Editor were resetted to default.
    Tha means I should go and re-arrange everything again after upgraded to 2.8. Is this normal? Anybody else met the same issue? If yes, are there any fixes to this?

    By the way, this is the bes plugin ever! Letting you customize your admin is someting that should be considered as a default option in any CMS. Luckly, White Shadow did a great work with this. Thanks.

  20. White Shadow says:

    For what it’s worth, upgrading to WP 2.8 worked fine for me – the settings were retained and the plugin still worked as expected. Perhaps in your case the settings were actually lost in the duplication process?

Leave a Reply