Recently I came across a question on WordPress Development StackExchange where someone was asking for steps to optimize WordPress with regard to server load. Here’s a link to the question if you’d like to see it for yourself. Most of the answers written under that question were technical. So I decided to write this article to help the common folk understand how to optimize WordPress performance.
Enable caching in WordPress
Install & activate the W3 Total Cache plugin for enabling caching functionality in your WordPress site. Activate page caching, database caching, object caching & browser caching feature from the plugin’s Settings page. Make sure you choose Alternative PHP Cache (APC / APCu) as the caching mechanism ‘if available’. Do NOT enable any minification in W3 Total Cache as there are many chances for you to break your site’s appearance and/or functionality. We’ll leave it to Cloudflare.
Use a Content Delivery Network
Once you’re done with configuring the rest of the plugin functionalities, set up Cloudflare for your website. Make sure you enable Cloudflare in W3 Total Cache settings too, under the Extensions menu.
Cloudflare is a Content Delivery Network that caches all the static contents (image files, CSS, JS, documents, etc.,) from your site and serves it to your visitors from their global servers. This can help speed up page load times and reduce the load on your server. For a list of file types that are cached by Cloudflare, check out this list. Moreover, Cloudflare has a free plan too.
In Cloudflare, set the caching level to standard and set browser cache expiration to something at least greater than 20 hours. Enable Always Online™ so that even if your server goes down, Cloudflare will serve your website’s static pages from their cache. Also, enable their auto-minify feature (remember why I asked you to not enable minification is W3 Total Cache? Because Cloudflare does it better!) Then set Rocket Loader™ to automatic.
Here’s an excerpt of what Rocket Loader does :
- Asynchronously loads scripts (including third-party scripts) so
that they do not block the content of your page from loading
- Caches scripts locally (using LocalStorage, available on most
browsers and smartphones) so they aren’t re-fetched unless
More information can be found here.
Use Genesis Framework for WordPress
If possible switch to the Genesis Framework by StudioPress for WordPress because their themes are clean, without any bloat. Genesis framework and their child themes are built with speed, security, and SEO in mind. I myself have tested it out around a few times and my Google PageSpeed scores were pretty damn good. Also if you’re using Genesis, then don’t forget to enable the ‘fragment cache’ extension in W3 Total Cache settings.
Since the Genesis Framework and all its child themes fall under the premium WordPress themes category (paid themes), not everyone can afford to buy them. So, I’ve got an excellent free Genesis theme alternative for you – GeneratePress, the new kid on the block whose performance can easily be compared to that of Genesis. Moreover, it is clean, simple, and weighs less than 1 MB. GeneratePress is just a single theme but it offers all the best features of the Genesis framework – it is lightweight and fast, fully mobile responsive, secure and stable yet developer-friendly with full microdata integration.
Bonus Reading –
Since now you’re using Cloudflare as a CDN, you can make use of a plugin like Smush, EWWW Image Optimizer, or ShortPixel Image Optimizer to compress your images. All three of them are free plugins available in the WordPress.org plugin repository. Also, Smush and ShortPixel support the powerful lossy compression algorithm.
Remove query strings
Note: You can also do this via Cloudflare without installing any plugin.
Use a good web hosting platform
By hosting your WordPress site on a good web hosting platform like Bluehost or DreamHost (that are officially recommended by WordPress), you can make sure that your site has all the resources at all times. This ensures that your site visitors don’t notice any degradation in service whenever they access your website.
Some of the key benefits of choosing a good web hosting platform are –
- More resources for WordPress to run in optimal condition
- Can manage sudden spikes in site traffic
- Can help you grow for some time peacefully without having to upgrade your plan immediately or find a new host
- Less chances of site going down due to unavailability of resources
- Very less to zero downtime due to server issues
- SSDs can greatly improve site speed all time round
- Proper backups to restore from in case something goes wrong
Optimize WordPress Database
Last but not least, use the ‘WP-Optimize‘ plugin to clean and optimize your database so that it runs more efficiently. You can also consider limiting and disabling post revisions in WordPress. If you don’t know how to do that, I’ve got you covered. Click here to read how to limit or disable WordPress post revisions.
Hope this article helped you in learning how to optimize WordPress to reduce server load and improve your site performance.
Also Read: How to make WordPress site HackProof