Home / admin / Remove sub-menu dashboard items
  • How to Remove sub-menu dashboard items

    no thumbnail sorry: Remove sub-menu dashboard items

    Adding this PHP code to your wordpress functions.php will allow you to remove menu items from the admin panel.

    ( click code to copy )

    wordpress snippet : PHP

    function remove_submenus() {
    global $submenu;
    unset($submenu['index.php'][10]); // Removes 'Updates'.
    unset($submenu['themes.php'][5]); // Removes 'Themes'.
    unset($submenu['options-general.php'][15]); // Removes 'Writing'.
    unset($submenu['options-general.php'][25]); // Removes 'Discussion'.
    unset($submenu['edit.php'][16]); // Removes 'Tags'.
    add_action('admin_menu', 'remove_submenus');

    ( WordPress codex functions, hooks, in this snippet. )

    admin_menu, add_action,
  • Ray Gulick

    What are the numbers? [10], [5], etc

  • gonza

    Cool. You should try Admin menu editor plugin, it’s a easier way to do this, especially if you want to activate-deactivate items several times. Great post!