-
Home
-
Contextual Related Posts
- Tips
How to Hide Contextual Related Posts Admin Menus
function plt_hide_contextual_related_posts_menus() {
//Hide the "Tools → Related Posts Tools" menu.
remove_submenu_page('tools.php', 'crp_tools_page');
//Hide the "Settings → Related Posts" menu.
remove_submenu_page('options-general.php', 'crp_options_page');
//Hide the "Settings → Upgrade" menu.
remove_submenu_page('options-general.php', 'crp_options_page-pricing');
}
add_action('admin_menu', 'plt_hide_contextual_related_posts_menus', 1000000000);
Where do I put this code?
How to Hide the "Contextual Related Posts" Meta Box
function plt_hide_contextual_related_posts_metaboxes() {
$screen = get_current_screen();
if ( !$screen ) {
return;
}
//Hide the "Contextual Related Posts" meta box.
remove_meta_box('crp_metabox', $screen->id, 'advanced');
}
add_action('add_meta_boxes', 'plt_hide_contextual_related_posts_metaboxes', 20);