-
Home
-
Autoptimize
- Tips
How to Hide the "Autoptimize" Admin Menu
function plt_hide_autoptimize_menus() {
//Hide the "Settings → Autoptimize" menu.
remove_submenu_page('options-general.php', 'autoptimize');
}
add_action('admin_menu', 'plt_hide_autoptimize_menus', 11);
Where do I put this code?
How to Hide the "Autoptimize this page" Meta Box
function plt_hide_autoptimize_metaboxes() {
$screen = get_current_screen();
if ( !$screen ) {
return;
}
//Hide the "Autoptimize this page" meta box.
remove_meta_box('ao_metabox', $screen->id, 'side');
}
add_action('add_meta_boxes', 'plt_hide_autoptimize_metaboxes', 20);