-
Home
-
Easy Google Adsense and Banner Ads Manager – AdsforWP
- Tips
How to Hide Easy Google Adsense and Banner Ads Manager - AdsforWP Admin Menus
function plt_hide_ads_for_wp_menus() {
//Hide "Ads".
remove_menu_page('edit.php?post_type=adsforwp');
//Hide "Ads → Ads".
remove_submenu_page('edit.php?post_type=adsforwp', 'edit.php?post_type=adsforwp');
//Hide "Ads → Groups".
remove_submenu_page('edit.php?post_type=adsforwp', 'edit.php?post_type=adsforwp-groups');
//Hide "Ads → Settings".
remove_submenu_page('edit.php?post_type=adsforwp', 'adsforwp');
//Hide "Ads → Upgrade To Premium".
remove_submenu_page('edit.php?post_type=adsforwp', 'adsforwp_data_premium');
}
add_action('admin_menu', 'plt_hide_ads_for_wp_menus', 11);
Where do I put this code?
How to Hide Easy Google Adsense and Banner Ads Manager - AdsforWP Meta Boxes
function plt_hide_ads_for_wp_metaboxes() {
$screen = get_current_screen();
if ( !$screen ) {
return;
}
//Hide the "Show Ads for Current Page?" meta box.
remove_meta_box('showadsforcurrentpag', $screen->id, 'side');
//Hide the "Ad Type" meta box.
remove_meta_box('adtype', $screen->id, 'normal');
//Hide the "Display" meta box.
remove_meta_box('display-metabox', $screen->id, 'normal');
//Hide the "Advanced Display Conditions" meta box.
remove_meta_box('adsforwp_placement_metabox', $screen->id, 'normal');
//Hide the "User Targeting" meta box.
remove_meta_box('adsforwp_visitor_condition_metabox', $screen->id, 'normal');
//Hide the "Set Expire Date" meta box.
remove_meta_box('setexpiredate', $screen->id, 'side');
//Hide the "AMP" meta box.
remove_meta_box('adsforwp-location', $screen->id, 'side');
//Hide the "Ad Group" meta box.
remove_meta_box('adgroup', $screen->id, 'advanced');
}
add_action('add_meta_boxes', 'plt_hide_ads_for_wp_metaboxes', 20);