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:

How to remove WordPress customizer elements

The WordPress personalizer is becoming more and more important in personalization but there comes a time when it has so many adjustments that can be confusing .

So this time we will see how to remove WordPress customizer elements leaving it alone with the essentials for the most common customizations.

This may be useful for you as an administrator, but also for not to dizzy your customers with too many options, or even to prevent them from changing things they do not owe .

The only thing you have to do is add a code like this to the file functions.php of the active theme or to your custom plugin :

If you look closely, every line that starts with $ wp_customize refers to to a section or panel of the customizer, and in the example there are 4 of them that have two bars (//) in front.

These bars what they do is to render the code ineffective, they make it a comment, so that will remove the sections or panels that do not have them leaving only these in view.

Another possibility is simply to erase those lines, but I preferred to leave it so that you know all the possibilities and you are the one choose what will be seen and what will not.

Summing up:

  • If a line has 2 The front bars will be seen in the customizer, because you cancel the code that removes them ( remove_section ).
  • If you do not have the 2 bars it will NOT be seen in the customizer, since the function is executed and will remove that That said, a complete customizer would be such that:

    And, once active the previous code would remain that way :

    And if you want to hide or show other different sections you already know how it's done

    Loading …

    That may also help you:

Export customizer settings

WordPress is increasingly using the customizer and the next versions will still use it more, but among all the new features and functionality there is one that is missing, and it is precisely more necessary the more you use it: to be able to export the customizer settings .

Notice that you can throw yourself away even hours customizing customizer settings on themes that make full use of it, such as Divi but what about a new installation? how do you re-apply that huge amount of adjustments that led to the conclusion that they were perfect? ​​ and after an uninstall or reinstallation?

I'd have you catch or point them out or go know.

] All that is over, because the plugin Customizer Export / Import precisely adds what is missing, a new section in the customizer from which you can export and import the settings .

 customizer export settings

Some important usage details:

  • You can only export settings for the active theme, not for themes that you are customizing in preview but that are not active.
  • The export files are associated with the theme, that is, you can not import the settings files from one theme to another, which has all the logic.
  • You can even import image files, like when you import entries . [19659011] export customizer settings ” width=”299″ height=”513″/>

    The exported file is such a thing internally, but do not worry, you do not have to understand it, just export it, keep it safe and import it when you need it …

     Otherwise, <strong> is perfect, and an essential tool </strong> if you create and personalize many websites with themes that use the customizer for your settings. </p>
<p> It's one of those plugins that <strong> should be incorporated already or yes to WordPress in future versions </strong>by offering a functionality that should have the default customizer without any doubt. Or, failing that, join the WordPress importer plugin, also a possible solution. </p>
<div id= Loading …

May also help you: