Skip to content

Instantly share code, notes, and snippets.

@joshjenkinsAR
Created May 29, 2018 14:28
Show Gist options
  • Save joshjenkinsAR/61df4f44c40b1cfe91bb73c039aea310 to your computer and use it in GitHub Desktop.
Save joshjenkinsAR/61df4f44c40b1cfe91bb73c039aea310 to your computer and use it in GitHub Desktop.
Hide various WordPress multisite admin menu items - much lighter than a bloated plugin. Hides unless user is super_admin.
//Custom admin hidden menu items
if ( !is_super_admin() ) {
add_action( 'admin_menu', 'custom_admin_menu' );
}
function custom_admin_menu() {
remove_menu_page('acf');
remove_menu_page('masterslider');
remove_menu_page('masterslider-setting');
remove_menu_page('genesis');
remove_menu_page('tools.php');
remove_menu_page('white-label-branding');
remove_menu_page('theseoframework-settings');
remove_menu_page('shortcodes-ultimate');
remove_menu_page('plugins.php');
remove_menu_page('link-manager.php');
remove_menu_page('options-general.php');
remove_menu_page('users.php');
remove_menu_page('edit.php?post_type=acf');
remove_menu_page('edit.php?post_type=acf-field-group');
remove_menu_page('edit.php?post_type=search-filter-widget');
remove_menu_page('edit.php?post_type=gravityview');
remove_menu_page('profile-builder-basic-info');
remove_menu_page('lfb_menu');
remove_menu_page('loco');
remove_menu_page('pressapps-knowledge-base');
remove_menu_page('edit.php?post_type=mapplic_map');
remove_submenu_page( 'themes.php', 'customize.php' );
remove_submenu_page( 'themes.php', 'themes.php' );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment