Remove Menus in WordPress Admin Menu and Dashboard

Written by on August 4, 2011 in WordPress - No comments
remove-wordpress-menu

Using WordPress as a CMS?

If you’re using WordPress as a CMS it’s a great idea to remove items from the left menu in the admin.

wordpress admin

For example, if you don’t have a blog on your site you don’t need the ‘Links’, and maybe you don’t need ‘Posts’, or ‘Comments’. Removing these items makes it a lot easier for your client to understand how to use the WordPress admin.

Paste the following code into the functions.php file of your theme. Then uncomment the items that you want to remove. You’ll see you can also remove items from the WordPress dashboard.

add_action('admin_menu', 'remove_menus', 102);
function remove_menus()
{
global $submenu;

remove_menu_page( 'edit.php' ); // Posts
remove_menu_page( 'upload.php' ); // Media
remove_menu_page( 'link-manager.php' ); // Links
remove_menu_page( 'edit-comments.php' ); // Comments
//remove_menu_page( 'edit.php?post_type=page' ); // Pages
remove_menu_page( 'plugins.php' ); // Plugins
//remove_menu_page( 'themes.php' ); // Appearance
remove_menu_page( 'users.php' ); // Users
remove_menu_page( 'tools.php' ); // Tools
//remove_menu_page(‘options-general.php’); // Settings

remove_submenu_page ( 'index.php', 'update-core.php' );    //Dashboard->Updates
remove_submenu_page ( 'themes.php', 'themes.php' ); // Appearance-->Themes
remove_submenu_page ( 'themes.php', 'widgets.php' ); // Appearance-->Widgets
remove_submenu_page ( 'themes.php', 'theme-editor.php' ); // Appearance-->Editor
remove_submenu_page ( 'options-general.php', 'options-general.php' ); // Settings->General
remove_submenu_page ( 'options-general.php', 'options-writing.php' ); // Settings->writing
remove_submenu_page ( 'options-general.php', 'options-reading.php' ); // Settings->Reading
remove_submenu_page ( 'options-general.php', 'options-discussion.php' ); // Settings->Discussion
remove_submenu_page ( 'options-general.php', 'options-media.php' ); // Settings->Media
remove_submenu_page ( 'options-general.php', 'options-privacy.php' ); // Settings->Privacy
}

Here is how a typical setup might look in your functions.php file:

remove-wordpress-menu

Resulting in this:

remove wordpress menus

About the Author

Mike Ilsley "ilz" is a Boston based website designer, front-end developer, WordPress addict, owner of Beantown Design, and exclusive ThemeForest author. Check him out on Twitter, Facebook, Google+ and don't forget to subscribe to the WebDesign&Such email RSS feed. Also, check out his latest project, jQueryMobileShowcase.com.