WordPress at a glance

remove_menu_page() WP 1.0

Remove a top-level admin menu.

  • Global. Array. $menu

No Hooks.


Array/true/false. The removed menu on success, false if not found.


remove_menu_page( $menu_slug );
$menu_slug(string) (required)
The slug of the menu.

Code of remove menu page: wp-admin/includes/plugin.php WP 5.2.1

function remove_menu_page( $menu_slug ) {
	global $menu;

	foreach ( $menu as $i => $item ) {
		if ( $menu_slug == $item[2] ) {
			unset( $menu[ $i ] );
			return $item;

	return false;

Related Functions

From tag: WP minimize (minimise reduce mitigate diminish lessen)

More from tag: Admin menu (admin panel)

No comments
    Hello, !     Log In . Register