-
Home
-
AMP
- Tips
How to Hide AMP Admin Menus
function plt_hide_amp_menus() {
//Hide "AMP".
remove_menu_page('amp-options');
//Hide "AMP → Settings".
remove_submenu_page('amp-options', 'amp-options');
//Hide "AMP → Analytics".
remove_submenu_page('amp-options', 'amp-options#analytics-options');
//Hide "AMP → Validated URLs".
remove_submenu_page('amp-options', 'edit.php?post_type=amp_validated_url');
//Hide "AMP → Error Index".
remove_submenu_page('amp-options', 'edit-tags.php?taxonomy=amp_validation_error&post_type=amp_validated_url');
}
add_action('admin_menu', 'plt_hide_amp_menus', 100);
Where do I put this code?
How to Hide AMP Meta Boxes
function plt_hide_amp_metaboxes() {
$screen = get_current_screen();
if ( !$screen ) {
return;
}
//Hide the "Status" meta box.
remove_meta_box('amp_validation_status', $screen->id, 'side');
//Hide the "Stylesheets" meta box.
remove_meta_box('amp_stylesheets', $screen->id, 'normal');
}
add_action('add_meta_boxes', 'plt_hide_amp_metaboxes', 20);