Skip to content

Instantly share code, notes, and snippets.

@permanart
Created December 14, 2020 04:19
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 permanart/e3f7b6a3f4a0c79f22493b4503e5c0cc to your computer and use it in GitHub Desktop.
Save permanart/e3f7b6a3f4a0c79f22493b4503e5c0cc to your computer and use it in GitHub Desktop.
Remove WordPress Admin Menu
/**
* Removes some menus by page.
*/
function dinoiki_remove_menus(){
remove_menu_page( 'index.php' ); //Remove Dashboard
remove_menu_page( 'jetpack' ); //Remove Jetpack
remove_menu_page( 'edit.php' ); //Remove Posts
remove_menu_page( 'upload.php' ); //Remove Media
remove_menu_page( 'edit.php?post_type=page' ); //Remove Pages
remove_menu_page( 'edit-comments.php' ); //Remove Comments
remove_menu_page( 'themes.php' ); //Remove Appearance
remove_menu_page( 'plugins.php' ); //Remove Plugins
remove_menu_page( 'users.php' ); //Remove Users
remove_menu_page( 'tools.php' ); //Remove Tools
remove_menu_page( 'options-general.php' ); //Remove Settings
}
add_action( 'admin_menu', 'dinoiki_remove_menus' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment