
How to Remove Unnecessary Menu Items from WordPress Dashboard
- January 27, 2017
- Leave a comment
Sometimes, you might want to cleanup unnecessary items from the admin panel (WordPress Dashboard) willingly. Reason being that a lot of things exist in the WordPress admin area which users don’t need/want to see or use. Following is a list of WP Menu items:
- Dashboard
- Posts
- Media
- Links
- Pages
- Appearance
- Plugins
- Tools
- Users
- Settings
In this article, you will learn how to get rid of these unnecessary menu items.
To achieve this functionality, you just need to add the following code in your Theme‘s functions.php file:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
// remove unnecessary menus from WordPress Dashboard function remove_admin_menus () { global $menu; $removed = array( __('Dashboard'), __('Posts'), __('Media'), __('Links'), __('Pages'), __('Appearance'), __('Tools'), __('Users'), __('Settings'), __('Comments'), __('Plugins') ); end ($menu); while (prev($menu)){ $value = explode( ' ', $menu[key($menu)][0]); if(in_array($value[0] != NULL?$value[0]:"" , $removed)){ unset($menu[key($menu)]); } } } add_action('admin_menu', 'remove_admin_menus'); |
This code will remove all the menu items from the admin area.
Additionally, from the $removed array, you can simply remove either one or more menu items which you don’t want to display in the admin area.
Thank you
This was just what I needed, thanks!