• Posted: 2010-09-10
  • Author: Filip Stefansson
  • Tags:

Disable top-level menus from Admin Panel 1

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
<?php
function remove_menu_items() {
  global $menu;
     unset($menu[15]); // Removes 'Links'.
     unset($menu[25]); // Removes 'Comments'.
}
add_action('admin_menu', 'remove_menu_items');
?>

Instructions:

This snippet disables top-level menus, like Comments, from the main menu in the Admin Panel. The menu-ID:s are found in wp-admin/menu.php.


Share this snippet

If you like this snippet, share it with friends!