-
Home
-
PPWP – Password Protect Pages
- Tips
How to Hide Password Protect WordPress Lite Admin Menus
function plt_hide_password_protect_page_menus() {
//Hide "Password Protect WordPress".
remove_menu_page('wp_protect_password_options');
//Hide "Password Protect WordPress → Settings".
remove_submenu_page('wp_protect_password_options', 'wp_protect_password_options');
//Hide "Password Protect WordPress → Partial Protection".
remove_submenu_page('wp_protect_password_options', 'ppwp-partial-protection');
//Hide "Password Protect WordPress → Sitewide Protection".
remove_submenu_page('wp_protect_password_options', 'ppwp-sitewide');
//Hide "Password Protect WordPress → Integrations".
remove_submenu_page('wp_protect_password_options', 'ppwp-integrations');
}
add_action('admin_menu', 'plt_hide_password_protect_page_menus', 11);
Where do I put this code?
How to Hide Password Protect WordPress Lite Meta Boxes
function plt_hide_password_protect_page_metaboxes() {
$screen = get_current_screen();
if ( !$screen ) {
return;
}
//Hide the "Password Protect WordPress" meta box.
remove_meta_box('ppw_pcp_meta_box', $screen->id, 'side');
//Hide the "Password Protect WordPress" meta box.
remove_meta_box('ppw_add_meta_box', $screen->id, 'side');
}
add_action('add_meta_boxes', 'plt_hide_password_protect_page_metaboxes', 20);