Skip to content

Instantly share code, notes, and snippets.

@steppohub
Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save steppohub/c8ea5461ddcdca7239c6 to your computer and use it in GitHub Desktop.
Save steppohub/c8ea5461ddcdca7239c6 to your computer and use it in GitHub Desktop.
remove menus (like comments)
function remove_menus(){
remove_menu_page( 'index.php' ); //Dashboard
remove_menu_page( 'edit.php' ); //Posts
remove_menu_page( 'upload.php' ); //Media
remove_menu_page( 'edit.php?post_type=page' ); //Pages
remove_menu_page( 'edit-comments.php' ); //Comments
remove_menu_page( 'themes.php' ); //Appearance
remove_menu_page( 'plugins.php' ); //Plugins
remove_menu_page( 'users.php' ); //Users
remove_menu_page( 'tools.php' ); //Tools
remove_menu_page( 'options-general.php' ); //Settings
}
add_action( 'admin_menu', 'remove_menus' );
PLUS YOU CAN DO THIS SORT OF STUFF FOR SUBMENUS (seems to work better for some of the submenus)
function as_remove_menus () {
remove_menu_page('upload.php'); //hide Media
remove_menu_page('link-manager.php'); //hide links
remove_submenu_page( 'edit.php', 'edit-tags.php' ); //hide tags
global $submenu;
// Appearance Menu
unset($submenu['themes.php'][6]); // Customize
}
add_action('admin_menu', 'as_remove_menus');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment