So ...
There are two common ways: installing a plugin or using a free third-party service ...
Let's start with a plugin-free solution. There are dozens of free, easy-to-use solutions out there ... My favorite is MinifyCode:
All you have to do is to select the desired tab (Javascript, CSS, HTML), to paste your code into the input field and to hit the "Minify" button:
It's a simple and efficient method ... which comes with a big disadvantage: you'll have to copy the HTML source code of every single page/post to minify it online, and then, you'll have to replace the original code with the minified version. Needless to say, there's a lot of room for errors and it can be really time-consuming ...
So let's see an easier and safer plugin-based solution ...
Colette and Philip