If my recent posts have been any indication, I’ve lately become obsessed with web site performance. A big reason for that is that I’m hosting all my personal sites at home, and while my server is quite beefy (even vastly overpowered for the task), I am limited by my internet connection. Sure, it’s fast, but it’s not exactly intended for hosting servers, and as such, my upload speed is quite limited. Of course, that’s not the only reason to optimize.
Optimization of your web site is important on many levels. Even though you’re likely not hosting at home like I am, odds are that you’re probably on a shared hosting plan with limited resources, or maybe even a low end VPS (I wrote a VPS guide here). You want your site to load fast, because your visitors aren’t likely to hang around while your site gets it together.
Multiple Layers Of Performance
While this is intended to be a quick and easy to follow guide, it’s important to have several layers of performance-enhancing strategies in place. It’s simple for any one thing to break many others (like minifying css/scripts using multiple plugins, as well as on Cloudflare).
Layer One – The Server/Host
The server is the place to start, and depending on your situation, you may or may not be able to do anything about this one, depending on your hosting provider plan. Not all hosts are created equal, but generally any web host owned by EIG (Endurance International Group) is plagued with performance issues due to overloaded servers, as well as less than stellar customer satisfaction. Here’s a list of hosts owned by EIG that you should avoid using if at all possible:
- A Small Orange
- Berry Information Systems L.L.C.
- Escalate Internet
- Host with Me Now
- Intuit Websites
- JustHost – 2011
- Networks Web Hosting
- SEO Hosting
- Southeast Web
- SuperGreen Hosting
- Webstrike Solutions
- Webzai – 2014
In addition to the above companies, I also recommend staying away from GoDaddy (a.k.a. NoDaddy, no!) based on performance in recent years.
So What Are Some Good Hosting Options?
The answer to that is directly dependent on your budget and needs. Many professional reviewers recommend services like SiteGround or WP-Engine, although this tutorial won’t be applicable to the latter due to a different hosting environment entirely. You can also try VPS hosting following my guide, which will be better and faster than any shared host. The techniques in this guide should work with most hosts though, even those under control of EIG.
Layer Two – Optimizing WordPress Itself
It’s best to start here before doing anything else. All the other tweaks won’t make much difference if WordPress itself is running like crap, so start with that.
Remove Unnecessary Plugins
Do you allow comments on your posts? Then why have Akismet installed?
Do you REALLY need Jetpack?
Are there any plugins taking care of tasks you could do manually, but you’re just lazy?
A lot of plugins don’t work very efficiently, and many run continuously, hogging server resources. If you don’t absolutely need it, de-activate it and remove it.
If you’re the only one editing your web site, I strongly recommend installing Heartbeat Control. Heartbeat is the WordPress process that monitors which user is editing a post at any given time, so that multiple users won’t interfere with each other. If you’re the only user, just turn it off completely with this plugin, otherwise you can lower the time period between checks to improve performance. This plugin will also dramatically improve the speed of your wp-admin.
If your site has been around for a while, you should run WP-Optimize. Over time, your database can get clogged up with useless and unused information. This plugin will scan for that information and remove it automatically. Make sure to back up before you run it!
Layer Three – Caching
Of all the steps in this guide, caching makes the biggest difference.
WordPress, at its core, is a PHP application that stores information inside of a database. Every time a user visits a page on your site, WordPress uses PHP to process the request, makes database queries, and outputs the result in the form of an HTML page. With caching, your site will be able to just serve up static HTML pages without intervention of PHP or a database. Considering most WordPress sites are not highly dynamic, this is ideal, since we don’t want to render a fresh page for every user.
There are a wide variety of caching plugins available for WordPress, including W3 Total Cache, WP Super Cache, WP Rocket (better, but paid, and more complex), and WP Fastest Cache. This guide will focus on WP Fastest Cache, since it’s the easiest for beginners to use and get the most out of, and performs very well.
So how do you enable caching with WP Fastest Cache? Simply install the plugin and tick the following settings:
There is a paid option if you need more speed, coming in at $39 for a lifetime license for one site. If you enjoy the plugin, go for it, but the free version should work fine for most sites.
Layer Four – Cloudflare
Now that you’ve maximized the performance of your site on your end, let’s speed up the delivery to your end users. Cloudflare can act as a sort of proxy between your site and your visitors. It offers a free plan that will provide free SSL (access your site via https:// and get that little padlock in the address bar), provides yet another layer of caching, and provides an always online option if your site goes down, as well as providing protection from DDoS attacks.
To get started, you’ll need to make an account at Cloudflare.com. The setup process there will walk you through setup, which involves logging in to your domain registrar and changing your nameservers to use Cloudflare. Don’t worry, it’s a lot easier than it sounds.
Once you’re set up, head on over to the speed tab, and be sure to disable minifying of your CSS and scripts. We already took care of that with our caching plugin, and don’t want to create any conflicts.
On a free account, Cloudflare allows up to three “page rules”, which are settings that will override the default settings. I recommend the following page rules for your site:
These Page Rules Explained
These page rules need to be in the exact same order as listed here. Replace the “justinboughton.com” parts with your own web site address.
Rule 1: Enforces HTTPS urls for your entire domain. If you’re getting mixed content errors, install the SSL Insecure Content Fixer. This greatly increases the security of your site, improves your SEO, and makes your visitors feel all warm and fuzzy inside.
Rule 2: Enforces Cloudflare and browser caching.
Rule 3: Bypasses caching and improves security for wp-admin.
It’s worth mentioning that if you plan to use Cloudflare, they do provide a WordPress plugin that can automatically clear the Cloudflare cache when your site is updated. This is probably a good idea. Additionally, depending on your site, you may occasionally experience some problems with wp-admin. If this happens, simply return to the Cloudflare control panel and temporarily disable the wp-* rule while making changes, and turn it back on when you’re done.
There’s a whole lot more than can be done to optimize the performance of your WordPress site, but you came here for the quick and easy version. If you have any doubts, you can always check the performance of your site before and after these tweaks using Google Page Speed, GTMetrics, or Pingdom.
Remember that it’s not healthy to obsess over performance too much unless it’s particularly bad, and some things, depending on your host, plugins, or even your theme, may be ultimately beyond your control. You are very unlikely to ever achieve a score of 100%. Still, if I can get results like these using a home brew server running over a residential cable connection, surely you can achieve greatness with a real web host!