Skip to content

Instantly share code, notes, and snippets.

@dipakcg
Last active June 15, 2016 15:15
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 dipakcg/9576d61f99a2eb4c725ee1b7dd28a705 to your computer and use it in GitHub Desktop.
Save dipakcg/9576d61f99a2eb4c725ee1b7dd28a705 to your computer and use it in GitHub Desktop.
WordPress - Remove menu or sub-menu page
/* ==========================================
Put the following code at the end of wp-config.php file to remove menu or sub-menu page.
========================================== */
/* *********
Line 10 will remove menu page of plugin: BackWPup
Line 11 will remove Settings menu
********* */
function dcg_custom_menu_page_removing() {
remove_menu_page( 'backwpup' );
remove_menu_page( 'settings' );
/* To remove a settings page for plugins that use a slug like /wp-admin/options-general.php?page=wp-performance-score-booster use this code: */
remove_submenu_page( 'options-general.php', 'wp-performance-score-booster' );
}
add_action( 'admin_menu', 'dcg_custom_menu_page_removing' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment