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. – Capiedge Jun 1 '16 at 14:08
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? – J. Doe Jun 1 '16 at 14:58
  • Sorry, it's nav_menus. – cjbj Jun 1 '16 at 15:02
  • I might be doing something wrong, or it's the code but the menu is still there. – J. Doe Jun 1 '16 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. – cjbj Jun 1 '16 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.. – J. Doe Jun 1 '16 at 15:23

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.