-
Home
-
AMP for WP – Accelerated Mobile Pages
- Tips
How to Hide Accelerated Mobile Pages Admin Menus
function plt_hide_accelerated_mobile_pages_menus() {
//Hide "AMP".
remove_menu_page('amp_options');
//Hide "AMP → Setup".
remove_submenu_page('amp_options', 'amp_options&tab=1');
//Hide "AMP → Settings".
remove_submenu_page('amp_options', 'amp_options&tab=2');
//Hide "AMP → Design".
remove_submenu_page('amp_options', 'amp_options&tab=20');
//Hide "AMP → Extensions".
remove_submenu_page('amp_options', 'amp_options&tab=31');
//Hide "AMP → Upgrade to Pro".
remove_submenu_page('amp_options', 'amp_options&tab=32');
//Hide "AMP → Documentation".
remove_submenu_page('amp_options', 'amp_options&tab=33');
//Hide "AMP → Import / Export".
remove_submenu_page('amp_options', 'amp_options&tab=34');
}
add_action('admin_menu', 'plt_hide_accelerated_mobile_pages_menus', 11);
Where do I put this code?
How to Hide Accelerated Mobile Pages Meta Boxes
function plt_hide_accelerated_mobile_pages_metaboxes() {
$screen = get_current_screen();
if ( !$screen ) {
return;
}
//Hide the "Show AMP for Current Post?" meta box.
remove_meta_box('ampforwp_title_meta', $screen->id, 'side');
//Hide the "AMP Page Builder" meta box.
remove_meta_box('pagebilder_content', $screen->id, 'normal');
//Hide the "Custom AMP Editor" meta box.
remove_meta_box('custom_content_editor', $screen->id, 'normal');
}
add_action('add_meta_boxes', 'plt_hide_accelerated_mobile_pages_metaboxes', 20);