Disable top-level menus from Admin Panel 1

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.

Code Snippet:

<?php
function remove_menu_items() {
  global $menu;
     unset($menu&#91;15&#93;); // Removes 'Links'.
     unset($menu&#91;25&#93;); // Removes 'Comments'.
}
add_action('admin_menu', 'remove_menu_items');
?>

Posted in Admin area