A Freelancer’s WordPress Page Load Speed Optimization Guide
WordPress speed optimization can sometimes be a daunting task, sure there are a lot of plugins to do the task but using/activating without prior knowledge to this plugins can sometimes break your website and cause you more trouble.
This isn’t your typical complete wordpress speed optimization guide. There’s propbably hundreds of guide out there which are more thorough and detailed but for this article, I will just show you what I did to my website to achieve almost perfect score in GTMetrix with the help of a few plugins. You can follow this quick guide to speed up loading time of your or your client’s website.
Image Optimization (FREE)
For image optimization I use Image optimization service by Optimole. This free plugin is fairly new compared to other image optimization plugin such as Smush, ewww image optimizer etc. After testing a few plugins, I decided to use this because it does all the things I want for image optimization such as lossless image compression, lazy loading, converting images in webp format, and delivering the right image sizes. On top of that, they have their own CDN that you can use for free.
Here’s a comparison of an image before and after I use the plugin:
As you can see above, the file size reduction was almost 40%. The CDN also helps reducing the server’s workload.
Caching and Minification (FREE)
For caching and minification, I use w3 Total Cache. I chose to use this plugin because I don’t have to use a separate plugin for caching and minification and it’s fairly easy to use for me since I’ve been using it for as far as I can remember. There are plenty of tutorials out there on how to configure this plugin such as this article but to make this simple I will just suggest to enable the following:
- Page Cache – Use Disk: Enhanced if you’re on a Shared Hosting
- Minify – Use Auto minify mode, things can get complicated if your website gets broken and you have to do the manual mode and add the css and JS files you want to minify manually, I may also suggest using a different plugin such as WP Fastest Cache if you are using Multi purpose themes because they use a lot of css and js files.
- Database Cache – Enable
- Object Cache – Enable
- Browser Cache – Enable
These are the important basic settings that you’d want to set, there’s also the CDN feature if you want to use CDN.
Database Optimization (FREE)
As you may be aware, WordPress relies heavily on its database, having cluttered database can affect your pagespeed significantly that’s why it is recommended to clean it up and optimize regularly. For this task, I use Wp Optimize, another free plugin that does the job very well. It’s basically a few clicks to to optimize your database but make sure you that you’ve already made a database backup just in case something went wrong.
Reducing HTTP Requests (Paid)
WordPress is notorious for generating so many http requests, that is because every plugins has its own CSS and JS files that are being called even though they are not being used in a specific page, there are also a lot of useless features that we don’t really need that WordPress loads thus heavily increasing the page size and load time of your website. To fix these issues, I used Perfmatters plugin. This plugin is easily one of the most powerful tool I’ve used for optimization and definitely worth the price.
Basically what it does is it can disable unused scripts (CSS and JS) that were being loaded in a page. For example, with the latest WordPress version, the new Gutenberg editor has added an extra CSS file, I am not using the Gutenberg editor therefore it’s just logical for me to disable it. This can also be done to plugins that were not being used in certain pages such as Gravity forms, Woocommerce, etc.
As you may have noticed, I only disabled the wp-embed js in current url because I might need to use it in a different page so I’m not totally disabling it.
Some other features of this plugins includes:
- Disable emojis
- Disable embeds
- Remove query strings
- Disable XML-RPC
- Remove jQuery migrate
- Remove WordPress version number
- Remove wlwmanifest link
- Remove RSD link
- Remove shortlink
- Disable RSS feeds
- Remove RSS feed links
- Remove Dashicons
- Disable scripts per page/post
- Disable scripts with Regex
- CDN Rewrite
- Disable Password Strength Meter
- Add blank favicon
- Disable Google Fonts
- Disable self pingbacks
- Disable WordPress Heartbeat API
- Change Heartbeat API frequency
- Disable and limit post revisions
- Disable REST API
- Remove REST API links
- Change autosave interval
- DNS prefetching
- Preconnect
- Disable WooCommerce scripts and styles
- Disable WooCommerce widgets
- Disable WooCommerce status meta box
- Disable WooCommerce cart fragments (AJAX)
- Disable Google Maps API
- Multisite support
- Change WordPress login URL
- Local analytics