Menus (Enable or disable WP Backend Menus)
I needed an mu-plugin to keep track of what menus I’ve enabled or disabled.
The SiteAdmin–>Options already does the Plugins menu, so I’ve add a bunch more.
If, like me, you need to hide the Themes Menu, or don’t want anyone messing with the Permalinks menu, or are frightened by the Delete Blog menu, this plugin will help.
I’ve added a checkbox to move the Design menu to the right, my preference.
I’ve added a checkbox to toggle a redirect to hide the Dashboard.
I’ve added a toggle to return the normal WP Media Buttons in the edit forms.
I’ve added wp-redirects: for example with a Settings->Permalink submenu disabled even if a user entered the options-permalink.php url in their browser, they arrive back at Settings->General.
Not all menus are listed, you could experiment easily enough, I figure.
Disabling the Widgets menu is not an option as it is added conditionally by the temlpate and is required by the dashboard.
There is also a checkbox for enabling all menus for SiteAdmin while leaving normal users with limited menus.
If you use other plugins to disable/hide admin menus, there will be collisions/errors. Happy testing!
The following menus are disabled by default giving you the option to turn them back on:
- Settings
- Settings General
- Settings Writing
- Settings Reading
- Settings Discussion
- Settings Privacy
- Settings Permalinks
- Settings Miscellaneous
- Settings Delete Blog
- Users
- Users Authors and Users
- Users Your Profile
- Write
- Write Post
- Write Page
- Mu Media Buttons
- Media Buttons
- Write Link
- Manage
- Manage Pages
- Manage Links
- Manage Categories
- Manage Link Categories
- Manage Tags
- Design
- Design Themes
- Manage Import
- Manage Export
- Move Design Menu to the Right
- Dashboard
Download: http://wpmudev.org/project/Menus







Very cool, I reckon this one will be pretty popular!
Looks good. Compatibility with 2.6 and 1.5.1 or 2.6 only?
mercime, mashed it together with a WPMU2.6 install. The “Design” menu and “Media Library” may be a hang-up with older versions, I figure.
BTW, just updated to fix a typo with the toggle for “Media Library”. Disabling the “Media Library” locks the user out of all upload iframes/menus. Maybe someone doesn’t want any uploading at all, or wants to turn it on and off (I like a lot of media upload control as a SiteAdmin at a school, hence . . .)
It’s cool to to be able to manage these options with checkbox. Is ‘redirect’ solution included so users can’t visit menu pages if they type actuall URL in their browser?
Cheers
It’s cool to to be able to manage these options with checkbox. Is ‘redirect’ solution included so users can’t visit menu pages if they type actual URL in their browser?
Cheers
Boonika, most, but not all, links redirect if the menu is disabled. Most redirect to their parent menu, then the parent redirects to the profile. Test your combinations thoroughly. The combinations made me whoozy after a while. With 30+ checkboxes I don’t even know how to determine how many combinations are possible. No doubt, certain combinations may be goofy. Happy testing.
Didn’t tried it out yet cause I’m pretty satisfied with the current ‘redirect’ and ‘hide menu’ mu-plugin. Code also provided by you (at WPMU forums). It works great in combination with Plugin Commander. All menus redirect to write-new.php. In future I’ll probably only have 2-3 levels of users and that means means I’ll have 2-3 versions of the mu-plugin I’m using right now… of course I plan to try ‘ Toggle Admin Menus Sitewide’.
dsader.. are u mind reader? :D thank u…
i got these with wpmu 1.5.1
Warning: Invalid argument supplied for foreach() in /var/www/terminalmusik.com/wp-content/mu-plugins/592867123_ds_toggle_admin_menus_13.php on line 149
Warning: Invalid argument supplied for foreach() in /var/www/terminalmusik.com/wp-content/mu-plugins/592867123_ds_toggle_admin_menus_13.php on line 160
indojepang, those lines are looking for User menu, are other plugins are colliding?
don’t understand what do u mean colliding? with what?..
here’s the list of my wpmu plugins :
wp_ozh_adminmenu.php
wp-comment-images.php
videos.php
unfiltered-mu.php
superlinks.php
rafik_ga.php
plugin-commander.php
permalink2post.php
page-navigation.php
page-management-dropdown.php
NotifyOnComment.php
extended_userprofile.php
custom-query-string-reloaded.php
BBpress.php
ah-recent-posts-mu-mod.php
1780703027_ft_wpmu_metatags.php
which one do u think it’s collide?
nope.. i’ve empty all the plugins still doesn’t work..
i’ve BBpress too..
indojepang, you’ll have to troubleshoot that yourself. Turn them all off. Try my plugin. Turn one back on, try again, continue.
Does the bbpress plugin do something to the default menus?
no luck with this plugin.. :( too bad
Thank u dsader.. i’ll try it later
Something similar… hope it helps.
http://wordpress.org/extend/plugins/wp-cms-post-control/
Thank u bonika! i know this plugin.. but it include the site admin, i just want the user admin..
cos it build for WP-single i know.. :( any hack of this? :P
Andrea_r pegged it on the WPMU forums, I didn’t think to put any “if(current_user_can(‘blah blah blah’) in any if statements- and there are a pile- one for each menu item. I tested combinations logged in as SiteAdmin and Blog admin, never author, contributor, or subscriber. My bad. Fix in the works. Gimme a couple days… and the (long)weekend.
very good sign! thankuuuu :D
Updated August 28/08, fixed a typo or two, added checks for user roles(thanks to andrea_r). Please kick this plugin around again(especially while logged in as subscriber/author/editor etc) and report here. Thanks for your comments. Your help is making this plugin better.
Beep.. beep… Whooosh!!
Smooottttthh!! Thank u Dsader!!! top needed plugin!
If we talk about this plugin’s usefulness it stands right next to Plugin Commander.
Did you test this with WPMU 2.6.1? I cannot disable some menus anymore, like Write (and its submenus), Manage (and its submenus), Settings…mhm…maybe all the menus you deal with.
Could you check this?
Thank you very much.
Nemo said, “anymore”. Have you clicked the SiteAdmin gets limited menus option, too? I use this plugin on a trunk install from mid September and it behaves as it did before the upgrade. I can’t imagine anything changing in core files that would disable the plugin completely unless you are still logged in as the SiteAdmin.
Yes, I have. The checkbox “Site Admin gets limited menus” is checked. In this case, if I have all the other checkboxes unchecked, I should have all the related menus disabled, do not I?
Moreover, I also tried with other kind of users (blog admin, editors…). Nothing. Like the plugin is not installed, but it is!
Any ideas?
Nemo, I see it now. I set line 45 to detect if any Settings exist but it is checking if any Settings menu values exist and not finding any returns without doing anything all. I wanted to have the plugin do nothing if options were not saved, but it shares the same db options as the default plugin menu so the menu options are never empty. Anyway, Edit line 45 to remove the check for Settings and all should be well. I’ll throw an update to the plugin page at wpmudev.org.
Dsader, maybe this was already answered but… As I understand, under Site Admin / Options you are able to enable (disable) Admin Menus for all blogs, right? What if you want to enable (disable) menus only for some blogs? That would be useful for WPMU with different level of Blog owners.
I’ll add few more words here. In my scenario, all new blogs would have enabled/disabled Admin Menus, previously set in Site Admin / Options (which is something this plugin already does, I believe). But If you want to, you could change those settings per blog.
Boonika, blog by blog can be managed by existing menu plugins for single Worpdpress and Plugin Commander can manage their activation per blog.
Oh, thanks. I’ll look for those plugins, but as I remember, I had problems with some of them (example: http://wordpress.org/extend/plugins/wplite/). That’s why I ended up using code for hiding menus (that you’ve posted at mu.wordpress.org), also in combination with Plugin Commander. Works fine. Ok, I’ll give wplite another try. Maybe now this plugin is bug-free. Anyway, I still think (my opinion) that it could be cool feature for future versions for your plugin because single WP plugin + Commander solution has it’s flaws. Especially if Top Admin decides to enable some menus for let’s say 3000 blogs. This is where your plugin shows it’s power.
Tried WPLite. Works great. I only tried setting it for Blog Admin (which is exactly what I need). But I think that I’ll stick to my previous solution cause I want to have menus disabled by default. Yes, Plugin Commander activates WPLite for every new blog created but I still have to disable menus manually. That’s why I’ll use your pre-menusplugin-code in combination with Plugin Commander. That way, all new blogs will have disabled menus by default and if I want to enable some menus for some Blog Admins I’ll simply write a new plugin, and activate it. Of course, before that, I’ll deactivate the old one. So I plan to have 3-4 plugins (every one of them disabling different menus) for 3-4 types of Blog Admins. So, (I hope) you see now why ‘enabling/disabling menus per blog’ would be cool extra feature for your plugin. But I understand that different MU admins have different needs. Thanks for your hard work. Cheers.
@dsader: thank you. I just read your answer and I am going to try. I’ll let you know.
Does this allow Site Admins to limit menus by Role? For example, I’d like ‘Administrators’ to see the ‘Themes’ menu, but not ‘Contributors’ or ‘Editors’…
webmaestro, default capabilities/roles are left as is. I use this plugin to turn off/on menus for all.
That might be a direction to go. I’ve got many levels of users, some of which I want to be able to see the THEMES menu item (admins) or the PLUGINS menu item (admins, editors), while there are some items I wouldn’t want anyone to see (DELETE BLOG).
This looks like a great addition to the WPMU repertoire! Thank you for your hard work!
Hi Dsader
This is an awesome plugin but am having 1 major problem. When I disable wp-backend menus from the interface with this plugin, only the text disappears but the arrow-drop down menu on the admin bar remains thus providing access to areas of the site I previously deemed hidden. This error occurs in Firefox 3, and IE 8, but not in Google Chrome or Safari. View my video to see exactly what I am talking about and let me know if you have any ideas. http://screencast.com/t/jqrqQ0IM
I am using wpmu 2.7 — Thanks
Terence
Terence, indeed some changes needed to be made in the plugin. However, if any other plugin adds a sumenu to Settings, say, the “unnamed menu” appears again, but not in Safari.
I still have not found why it differs under Safari vs. Firefox, curious.
The left menu works as expected, but the adminbar code builds the menus differently, dynamically – I have to look at that more closely.
…
…
…
I have fiddled away for a few hours and am no closer to a complete solution other than to avoid using the built in adminbar in place of a hardcoded mu-plugin adminbar substitute.
I’ve uploaded what I’ve done so far. http://wpmudev.org/project/Menus
Hi David,
Thanks for looking into this so quickly. That’s awesome! I tested out the newest download and was able to duplicate what you found. Now, there is only only 1 hidden menu that is showing in firefox and ie 8. I will keep testing it out and provide feedback as much as possible. I’ll keep checking back here for the latest version. Thanks for your hard work!
Terence