Disable the Customizer
Removes the Customizer for every user, including its admin menu and admin bar links, on sites that are configured elsewhere.
Opens WPIDE on
Code
add_filter( 'map_meta_cap', function ( $caps, $cap ) {
if ( 'customize' === $cap ) {
$caps[] = 'do_not_allow';
}
return $caps;
}, 10, 2 );
add_action( 'admin_bar_menu', function ( $wp_admin_bar ) {
$wp_admin_bar->remove_node( 'customize' );
}, 999 );
Notes
Classic themes that keep their logo, colors or menus in the Customizer lose access to those settings.
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.