X

Disable submenus from Admin Panel

This snippet disables submenus, like Themes and Writing, from the Admin Pane. The menu-ID:s are found in wp-admin/menu.php.

Code Snippet:

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

Comments  Leave a Reply

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our privacy policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

WordPress Launch Checklist

The Ultimate WordPress Launch Checklist

We've compiled all the essential checklist items for your next WordPress website launch into one handy ebook.
Yes, Send Me the Free eBook!