Let's say there is a theme that you like but you want to make some changes. You make a child-theme. At least you do if you follow good advice. So now you have a child theme. You are happy with it and want to share. There is just one small problem - one of the controls in the customizer makes no-sense with the changes you have made.

How do you make the customizer control from the parent theme go away for your child theme?

1 Answer 1


From the documentation:

To add, remove, or modify any Customizer object, and to access the Customizer Manager, use the customize_register hook:

function themeslug_customize_register( $wp_customize ) {
  // Do stuff with $wp_customize, the WP_Customize_Manager object.
add_action( 'customize_register', 'themeslug_customize_register' );

The Customizer Manager provides add_, get_, and remove_ methods for each Customizer object type; each works with an id. The get_ methods allow for direct modification of parameters specified when adding a control.

function my_customize_register( $wp_customize ) {




So in your case, you can remove a control using WP_Customize_Manager::remove_control().

Example for the Twenty Nineteen theme:

function my_theme_customize_register( $wp_customize ) {
    // Remove the Colors -> Primary Color option.
    $wp_customize->remove_control( 'primary_color' );
add_action( 'customize_register', 'my_theme_customize_register', 11 );

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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