I need to customize the admin panel for my user. So how do I remove the entire admin menu? Not remove the menu item, I mean entirely remove the left vertical menu bar, include the design of the menu (eg, css, background..etc). I want it become blank.
I can do it by css hack. But I prefer to use hook to do it. Any ideas?
Thanks
The correct hook to use is
admin_menu
and then create a function to remove the menus you want to remove. The following 2 functions remove all the menus.Screenshot of left menu using the above 2 functions:
Following the lead of
/wp-admin/admin-header.php
->/wp-admin/menu-header.php
there’s no hook to do it.A solution is to hook in
admin_head
and do some CSS + jQuery[update]
As per a clarification to the question, where it gets clear that the motivation is branding the admin area, these are the 4 plugins that I use for that:
The only hook-friendly way I know is to use
remove_menu_page()
for every single menu item. Even then, I don’t know what happens to the left bar itself (whether it would collapse down to 0px width or what). Even with using the hooks, I imagine at some point you’ll want to enqueue an admin stylesheet to cleanup what remains of the menu markup styles.I would be careful about doing this. For instance, if you remove “Settings,” then any plugins that creates menu pages in the “Settings” menu can’t be reached. In general, I wonder how sustainable it really is to completely remove the menu.
I improve the solution of @brasofilo as it is have small bug – on page reload with not best internet connection menu will appear for very short time. To avoid it I added a bit of more css: