# remove\_menu\_page,remove\_submenu\_page full (ok)

[How to hide the menu item created by the theme in WordPress admin panel?](https://wordpress.stackexchange.com/questions/268266/how-to-hide-the-menu-item-created-by-the-theme-in-wordpress-admin-panel)

```
function custom_menu_page_removing() {
    remove_menu_page( $menu_slug );
}
add_action( 'admin_menu', 'your-MENU' );
```

Ví dụ: $menu\_slug **is** woovina-panel

```
add_action( 'admin_init', 'wpse_136058_debug_admin_menu' );
function wpse_136058_debug_admin_menu() {
  remove_menu_page('woovina-panel' );
}
```

{% embed url="https://specialtouchgifts.com.au/wp-admin/admin.php?page=woovina-panel" %}



```
function wpse_136058_debug_admin_menu() {
  remove_submenu_page( 'themes.php', 'infinite-photography-pro-license' );
  remove_menu_page( 'edit.php?post_type=acf-field-group');
  // remove_menu_page("users.php");
}
```

{% embed url="http://localhost/wordpress5/wp-admin/admin.php?page=under-construction" %}

```
add_action( 'admin_menu', 'wpdocs_remove_menus' );
function wpdocs_remove_menus(){
  remove_menu_page( 'under-construction' );
}
```

![](https://2370029328-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LWPtKFbhw0XehxVuoiZ%2Fuploads%2FS7iRiZ8x83LUpcZs962t%2FScreenshot_5.png?alt=media\&token=1c43a1a6-9b11-43a2-8ea0-f39cb7f4ae52)

Đôi khi người ta chọn slug kiển truyền tham số ta có thê rời menu như sau?

```
add_action( 'admin_menu', 'wpdocs_remove_menus',  99);
function wpdocs_remove_menus(){
  // remove_menu_page( 'plugins.php' );
  remove_menu_page( 'tools.php' );
  // remove_menu_page( 'themes.php' );
  // remove_menu_page( 'options-general.php' );
  // remove_menu_page( 'users.php' );
  // remove_menu_page( 'under-construction' );
  // remove_menu_page( 'hdq_quizzes' );
  remove_submenu_page( 'hdq_quizzes','admin.php?page=hdq_addons');
  remove_submenu_page( 'hdq_quizzes','hdq_options');
  remove_submenu_page( 'hdq_quizzes','admin.php?page=hdq_triviadb');
  remove_submenu_page( 'hdq_quizzes','admin.php?page=hdq_tools');
}
```

![](https://2370029328-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LWPtKFbhw0XehxVuoiZ%2Fuploads%2Fr3cvqkuMiGVijup9Arv0%2FScreenshot_1.png?alt=media\&token=fe2ecef0-a158-4e39-bdda-d62c234273f2)

