How to allow arbitrary inline CSS in posts?

Sometimes, I want to apply inline style—i.e. custom CSS for a single element, oftentimes unique across the site.

But, with a very few exceptions, WordPress seems to strip these out. When I, the site administrator and post author, add certain CSS directives, they are removed, and I cannot find any setting to stop this from happening.

So far, I have found it to remove:

  • white-space
  • outline
  • image-rendering

I am aware that UGC is highly volatile, and it's vital for security to apply deep sanitization to any rich content in comments, but I would like a bit more access to design my website and its content as I please.

How can I allow such CSS directives only for posts?

Topic sanitization css posts Wordpress

Category Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.