For the record, I cannot guarantee that my configuration is going to work flawlessly on your site (it could though). Consider this tutorial as a set of options for you to try. I recommend Googling “WordPress speed” and go through all the links on the first page at least.
It is important to note that my site is on shared hosting, and all plugins and services mentioned here are free. I am running ads on posts and some pages so load times on those may be a bit slower.
As always, create a backup before making changes to your site. Clear cache or disable existing caching plugins, and temporarily go on development mode (if using a CDN like CloudFlare).
Smush + Jetpack
Smush Image Compression and Optimization or simply Smush is pretty straightforward, a must-have for image optimization. I can confirm it doesn’t break my site when used together with Jetpack’s Site Accelerator. Both plugins offer lazy loading, but it’s not a good idea to activate both. I’m only using the one from Smush.
I’ve disabled Site Stats on Jetpack because it is slowing down my site according to speed tests. Deactivating Jetpack modules that are not being used helped improve my site’s speed. Out of 43 modules, only 7 are active here.
Depending on how fancy your site is, these two plugins can either work wonders for you or mess everything up. I’ll share my configuration, but please proceed with caution. If items are not listed here, I left those untouched.
Adding exclusions or URLs to preconnect to are entirely up to you.
Setting up Autoptimize takes a bit more time. Here are my choices:
Aggregate JS-files? Yes
Also aggregate inline JS? Yes
Optimize CSS Code? Yes
Aggregate CSS-files? Yes
Also aggregate inline CSS? Yes
Generate data: URIs for images? Yes
Inline and Defer CSS? Yes*
*Use a Critical Path CSS Generator, copy all the contents from the first box (Critical Path CSS) and paste it in Autoptimize.
Optimize HTML Code? Yes
Save aggregated script/css as static files? Yes
Extra Auto-Optimizations (under the Extra tab)
Google Fonts: Remove Google Fonts
Remove emojis: Yes
Remove query strings from static resources: Yes
Remember to save changes. 🙂
Autoptimize Status: Enabled
Autoptimize Method: Defer
Google Fonts Typography + Host Google Fonts Locally
Note that I mentioned removing Google fonts via Autoptimize and the reason is to allow hosting the fonts locally. This would make it possible to cache the font files. Doing this manually is not exactly for beginners but thanks to Google Fonts Typography and Host Google Fonts Locally, you can simply install the two plugins and you’re ready to go. Google Fonts can be switched through Appearance > Customize.
Comet Cache + .htaccess
Out of all the caching plugins I’ve tried, Comet Cache is one of the easiest to configure and it’s compatible with Autoptimize. I’ve left everything on default settings except one.
Under Apache Customizations, turn off GZIP Compression and add the following to your .htaccess file:
Also, add these lines in .htaccess to leverage browser caching:
You can specify a different set of values depending on your preference.
Improve WordPress Speed on Shared Hosting
This is where Cloudflare comes into play. I strongly recommend using a CDN especially websites on shared hosting like mine.
Security level: Medium [leave as is, consider adding a Page Rule*]
Caching level: Standard [leave as is, consider adding a Page Rule*]
Auto Minify: Enable Auto Minify for JS, CSS, and HTML [turn this off if using Autoptimize]
Browser Cache Expiration: 4 hours [change to Respect Existing Headers]
Always Online: On [leave as is]
Development Mode: Disabled [leave as is]
IPV6 Compatibility: Off [turn this on]
WebSockets: On [leave as is]
IP Geolocation: On [leave as is]
Email Address Obfuscation: On [leave as is]
Server-side Excludes: On [leave as is]
Hotlink Protection: Off [turn this on if you like]
Image optimization (Polish and Mirage): Off (unless on Pro or higher plan) [obviously, a broke millennial on a free plan can’t turn this on]
*Read more about Cloudflare page rules here.
Other Stuff To Consider
Cleaning up the database with WP-Optimize
Even websites need to detox. This process can be scheduled, however, I prefer doing this manually. I absolutely love how easy this plugin makes database cleaning, particularly the tables that some uninstalled plugins leave behind.
Implementing Accelerated Mobile Pages (AMP)
This part used to intimidate me because not all website owners are supportive of the Google AMP Project. I’ve configured AMP for my site regardless. You’re probably reading the AMP version of this article if you’re coming from a Google search. I’m using AMP for WP. Performance-wise, I think AMP pages are okay, but it’s ridiculous that forms (contact, email opt-in, comment, etc.) don’t work on those. So, optimizing the responsive/mobile version of a website is still important. Simply put, AMP is not a solid replacement for responsive themes yet.
Unless one is willing to pay for Pro AMP features.
I can’t (don’t know how to) convert my non-AMP mobile site into a 100% error-free AMP. The best I can do is design the AMP version to look as close as possible to the non-AMP version. The colors and fonts look kinda similar at least.
WordPress Speed Testing
If you run tests on this site, my page scores are not perfect, I know. Still pretty good though considering I’m not paying for anything else other than domain and hosting.
My go-to sites for testing are GTMetrix (to find specific items slowing down the site) and WebPageTest.org (for precise speed metrics like First Byte and Total Load Times). Pingdom is nice too for quick tests from different locations. I recently discovered a site called Batch Speed and it’s awesome for bulk speed tests.
I’m not a WordPress speed ninja, but all the things I mentioned here worked for me so I hope this article helped you in any way.
Last Updated on