If your WordPress runs slow and your GTmetrix/PageSpeed/Yslow scores are not the best, check these four easy steps to make them fly and reach the scores of the next picture with almost zero effort!
STEP 1: INSTALL AUTOPTIMIZE
Get Autoptimize here or search for “autoptimize” within your WordPress admin (in the “plugins -> add new” section), install and activate it.
Now browse to the plugin’ settings page and activate these settings:
- Optimize HTML Code
- Optimize CSS Code
I usually leave empty the “CDN Base URL” because I couldn’t find a fee CDN to use with WordPress, if you know one please drop me a comment!
In the “extra” section on the settings you can try to tweak a few more parameters (especially if your theme uses Google Fonts).
STEP 2: INSTALL CACHE ENABLER
This plugin is great because it caches a completely rendered copy of every page of our blog, lowering to the bare minimum the computation needed to generate any page when a user will browse.
Get Cache Enabler here or search for “cache enabler” within your WordPress admin (in the “plugins -> add new” section), install and activate it.
Now browse to the plugin’ settings page and use these settings:
- Cache Expiry: 0 (cache will never expire unless… read the next point)
- Cache Behavior: “Clear the complete cache if a new post has been published”
- Cache Exclusions: leave the field empty unless you have special needs
- Cache Minification: Disabled (it’s done by Autoptimize)
STEP 3: INSTALL WP SMUSH IT (optional, if you don’t post images)
This plugin allows us to automatically compress (without loosing quality) every image we upload to our WordPress, not to waste bandwidth both for us and the visitors (and Google is very happy about this behaviour).
Get WP SmushIt here or search for “smushit” within your WordPress admin (in the “plugins -> add new” section), install and activate it.
Right after installation a popup will ask you which settings you want to enable, I use the “Automatically smush my images on upload” and nothing else. If you’re a photographer you maybe want to enable the “Preserve EXIF data”.
Smushit settings for this blogAlso, WP Smush it allows you to bulk process all pre-existing images, and that’s just great!
STEP 4: TWEAK YOUR .HTACCESS FILE
As a last step let’s tell the web server to compress things as much as possible and let’s tell the visitors’ browsers to use their own cache too.
Open the “.htaccess” file in the root directory of your WordPress installation and, at the beginning of the file, before anything else (and without touching anything else) simply paste the next few lines:
Drop me a comment ;-)