-
Home
-
WP Page Widget
- Tips
How to Hide Wordpress Page Widgets Admin Menus
function plt_hide_wp_page_widget_menus() {
//Hide the "Settings → Page widgets settings" menu.
remove_submenu_page('options-general.php', 'pw-settings');
//Hide the "Settings → Search page widgets" menu.
remove_submenu_page('options-general.php', 'pw-search-page');
}
add_action('admin_menu', 'plt_hide_wp_page_widget_menus', 11);
Where do I put this code?
How to Hide the "Page Widgets" Meta Box
function plt_hide_wp_page_widget_metaboxes() {
$screen = get_current_screen();
if ( !$screen ) {
return;
}
//Hide the "Page Widgets" meta box.
remove_meta_box('pw-widgets', $screen->id, 'advanced');
}
add_action('add_meta_boxes', 'plt_hide_wp_page_widget_metaboxes', 20);