Remove Admin Menus


/ Published in: PHP
Save to your folder(s)

Clean up your WordPress backend by removing unwanted admin menus that create clutter.


Copy this code and paste it in your HTML
  1. // Remove Admin Menus
  2. function remove_menu_items() {
  3. global $menu;
  4. $restricted = array(
  5. __('Links'),
  6. __('Comments'),
  7. __('Media'),
  8. __('Plugins'),
  9. __('Tools'),
  10. __('Users')
  11. );
  12. end ($menu);
  13. while (prev($menu)) {
  14. $value = explode(' ',$menu[key($menu)][0]);
  15. if(in_array($value[0] != NULL?$value[0]:"" , $restricted)){
  16. unset($menu[key($menu)]);
  17. }
  18. }
  19. }
  20. add_action('admin_menu', 'remove_menu_items');

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.