I want to remove/disable the 'Active Theme' section from customizer. What could be the best way to do it? enter image description here


Untested, but this should do the trick:

function wpse293862_remove_themes_panel() {     
  global $wp_customize;

  $wp_customize->remove_panel( 'themes' );

add_action( 'customize_register', 'wpse293862_remove_themes_panel', 11 );
  • tested. It's working – melvin Feb 12 '18 at 11:35
  • 1
    Yes, this is the approach I would recommend. – Weston Ruter Feb 20 '18 at 1:13

To remove a panel completely use the WP_Customize_Manager class remove_panel( string $id ) method. Reference https://developer.wordpress.org/reference/classes/wp_customize_manager/

function themeslug_customizer_remove( $wp_customize ) {
    $wp_customize->remove_panel( 'themes' );
add_action( 'customize_register', 'themeslug_customizer_remove' );

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.