The real reason you want to minify your WordPress files is to improve the performance of your website. Minification is the process of minimizing code and mark-up in your web pages and script files. The term ‘Minify’ is used to describe a method that makes your website file size smaller.
It includes whitespaces, line breaks, comments, and block delimiters which are useful for us humans but unnecessary for machines.
When the minification process is done, it removes the following things from the code:
The minification only decreases a few kilobytes of data on most WordPress sites. You can reduce more page load time by simply optimizing images for the web.
Here is an example of normal CSS code:
After minifying the code it will look like this:
It allows you to combine and minify your CSS and JS files to improve page load time. This plugin uses the PHP library Minify and relies on WordPress’s enqueueing system rather than the output buffer, which respects the order of CSS and JS files as well as their dependencies. BWP Minify is very customizable and easy to use.
The first thing you need to do is install and activate the Better WordPress Minify plugin. Upon activation, the plugin will add a new menu item labeled ‘BWP Minify’ to your WordPress admin bar. Clicking on it will take you to the plugin’s Settings page.
You can now click on the Save Changes button to store your settings.
There are many other advanced options on this page. The default settings will work for most websites, but you can review and change these options on a case by case basis.