Scroll down to skip the article and go straight to the code snippet.
Last november WordPress 4.9 was released. As every new WordPress version it came with some really neat features. One of those new features was the syntax highlighting. A feature a lot of people wanted for a long time finally made it into core. No plugin needed anymore. Hooray!!
However at the same time WordPress tries to discourage you to touch the code in the theme editor at all. Why? It confuses me because why would you enhance something if you don’t want people to use it anyway? They could have made editing the stylesheet impossible or restrict editing it to the admin user role. But that’s not what the developers did. They choose to show you an undismissable warning notice instead.
They rather want you to put the css code in the customizer meaning it gets loaded as inline styling in the front of your website. That is not always what you want. For instance when you are working with a child theme and you want to make more than just a few changes to the css. Well, WordPress still allows you edit and save through the theme editor so there is no real problem.
But there is that message. It keeps staring at you while you are editing the css like it’s the wrong thing to do. If only there was a way to dismiss this message. Well now you can. Here is a little snippet. Save it to your functions.php or even better, save it to a code snippet plugin and say goodbye to that message forever.