How to remove the additional CSS from the WordPress Customizer

From WordPress 4.7 we have in the Customizer the option of " Additional CSS ", with the that add custom CSS classes to our site, and although it is a fantastic utility if you know CSS is a nuisance for which you have no idea or do not want to use it or take up space in the Customizer.

many situations in which it is possible that you prefer not to display the option of " additional CSS " in the Customizer .

From customers of the that you do not trust that they are retouching what they do not owe to collaborators who will be attracted to modify styles of the web at the first exchange.

So let's see several ways of remove the option of " Additional CSS " of Customizer from WordPress .

Remove the additional CSS option from the Customizer

The quickest and easiest way is to add the following code to the file functions.php of the active (child) theme :

With the above code you remove the utility, but you can go a step further to remove the section whole To do this you must replace the last line of code with the following, like this:

Control which user profile can see or not the CSS Additional

Another possibility is that controls it for each user profile . For this nothing better than the Members plugin a gem that I have always used.

You only have to edit the profiles you want to disable this possibility and uncheck the permissions of " HTML without restrictions "

What if I want a user profile to have HTML with no restrictions but no access to additional CSS?

Well, in this case you just have to add the following function to your functions.php :

This time the permission assignment is modified so that the filter hook map_meta_cap which is the one that enables unrestricted HTML, can not edit CSS.

Loading …

also help you:

Leave a Reply

Your email address will not be published. Required fields are marked *