2

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
  • You need to know the specific ID name, in order to successfully apply the remove_controlor the remove_sectioncommand. Inspect the code to find it. In the link that you provide it's well explained. Commented Jun 1, 2016 at 14:08

1 Answer 1

0

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.

7
  • this removes the items from the image but Menu's is still there, any way to fix this? Commented Jun 1, 2016 at 14:58
  • Sorry, it's nav_menus. Commented Jun 1, 2016 at 15:02
  • I might be doing something wrong, or it's the code but the menu is still there. Commented Jun 1, 2016 at 15:14
  • If you use Chrome or Firefox you can right click on the item and choose 'inspect element'. You will get something like <li id="accordion-section-nav_menus" .. > Maybe it is not section but panel. Then you need remove_panel. Commented Jun 1, 2016 at 15:19
  • I tried inspecting it and it says "nav_menus", so it must be the right one - also when using remove_panel, it doesn't remove it either... the big Wordpress mystery.. Commented Jun 1, 2016 at 15:23

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.