WordPress 4.7 introduced a section in the Customizer called Additional CSS. This section should replace the Custom CSS option that many themes include in their Theme Options, or those plugins created for the same purpose.

Sometimes though, especially for developers, this could be a bad feature, because they don’t want their customers to edit CSS as they want.

How to remove the Additional CSS from the Customizer?

Open the file functions.php in wp-content/themes/your-child-theme-name/ and add this code at the end of the file:

This code will remove completely the Additional CSS section from your WordPress site.

Remove the Additional CSS Conditionally

What if you want to remove it for everyone except administrators? In that case you’d need to check the user role too, and you can do it so:

This code will remove the section for everyone who can’t manage_options, so everyone who is not Admin or Super Admin.

You can do even more, and leave it only for specific users based on their ID:

This code will remove the Additional CSS from any user that is not ID 1, which usually is the first user created when creating the WordPress site.

2 replies
  1. Daniel McClure
    Daniel McClure says:

    I actually just built (customised) my first custom Genesis child theme entirely through the Additional CSS feature and of course the trusty functions.php file. The customizer has come a long way and as such probably introduces a lot of easy ways to break things if you don’t know what you are doing! I generally try and educate my clients and partners rather than restrict them, but I’m sure this snippet will be useful at some point!

    • Nicola Mustone
      Nicola Mustone says:

      Personally I prefer to work always on files directly instead of using WP editors (both for PHP and CSS), but it’s just that I’m used that way.

      About customers, I prefer to restrict them if I can. They are not devs and they don’t need to know/have access to those things. I give them access to everything else, but not to code just to avoid them breaking stuff by mistake.


Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply