Remove all theme customizer inline css in WordPress

Recently I had trouble removing all the inline CSS created by the Theme Customizer. As I like to use normal CSS files (with LESS & Grunt of course) I was desperately looking for a way to purge these evil lines.

After searching for over an hour I found that it’s as simple as putting the following code in your functions.php file:

add_action('init', 'remove_all_dirty_css'); 
function remove_all_dirty_css() { remove_theme_mods(); }

You only have to call this function once, so you can delete it after the first request.

Geef een reactie

Het e-mailadres wordt niet gepubliceerd. Vereiste velden zijn gemarkeerd met *