Removing pre existing menu item

I want to remove the following items from the customizer menu:

However, I already tried a few codes from other Stack questions but with no luck!

Is it even possible to remove those?

1 Answer
1

Here you go:

$wp_customize->remove_section('colors');
$wp_customize->remove_section('nav_menus');
$wp_customize->remove_section('static_front_page');

EDIT AFTER DISCUSSION

After testing I found that this doesn’t work for nav_menus. You have to set a higher priority on the hook, like this:

add_action( 'customize_register', 'remove_nav_menu_section', 20 );

This gives a php warning from WP but otherwise does the job.

Leave a Comment