Website loading speed has been a hot topic for a little while now and this isn’t something that is going away. WordPress website speed comes up a lot and the is a fairly large conception that WordPress websites are slow, and a lot of people ask me how to speed up WordPress websites.
To say this is a generalisation is an understatement as WordPress websites come in all shapes and sizes, some are slow and some are not slow. Also, non-WordPress websites can also be slow or not slow.
WordPress gives you a lot of flexibility to build websites, but with such a huge array of plugins, themes and features, it can be very easy to all of a sudden end up with a slow website if you are not keeping an eye on it.
Here’s my top 6 tips for keeping your WordPress website speed up.
Speed Up WordPress Websites – 6 Essential Tips
OK, hold up, before we get started, let’s do some bench marking. Before you start trying to speed up your website, it’s a good idea to test how fast your site is right now. Two of the best tools out there are GT Metrix and Pingdom.
For the purposes of this article I’m going to be using GT Metrix as it’s what I prefer. I find the user interface easier to get along with and over the years it’s helped me to speed up a lot of sites.
So, head over to GT Metrix and enter your website’s URL, it’ll take a few moments, but then you’ll get your results:
OK, 1.3s to load my home page. That’s not too bad. This is what I’ve managed to achieve with what I’d consider my “standard” speed optimisations. So let’s see what they are.
1. Use your end point URL
I’m going to kick off with a really simple one. This isn’t actually a change to your website at all, but more you can help yourself, especially when sharing your website address on-line or sending it to someone in an email. The end point URL for my home page is https://www.bedevious.co.uk/. There are a few other versions of this that will still work and you’ll end up at the end point all the same, some of these are:
- https://www.bedevious.co.uk/ – http instead of https
- http://bedevious.co.uk/ – http instead of https and without the www.
- https://bedevious.co.uk/ with the https but no www.
Now, if you use thes URLs, when the request arrives at the server, the first thing that will happen is that you are redirected to the https version. I have an SSL certificate for security, but it also helps with SEO, according to Google. And so I want everyone to visit using this version.
As a preference, my site keeps the “www.” in front of the domain. Don’t ask me why, I just prefer it. So, people who visit without a www. are redirected to the version with the www.
If you visit without the https or the www. you’ll be redirected twice. This all adds time to how long it takes to load the page. How much time I hear you ask? Well let’s use GT Metrix to compare the page load times:
I’ll be honest, even I was was surprised to see such a large difference, but it goes to show heading straight to the end point puts on the best starting point to speed up your WordPress site.
2. Image sizes
The images you put on your website are one place you can almost always look to speed up your website. They are normally the largest part of a webpage (in terms of file size) and so downloading hefty image files can slow you down a lot.
The secret here is to reduce the size of your images so that they are the size of the space you need to fill so that your users are not downloading a 1000px wide image to fill a 700px space. If people are interested I’ll add some detail on how to calculate the maximum width available for an image.
The good news here is that GT Metrix will highlight images that could be smaller and then even tell you how big to make them. Just look for the “Serve scaled images” section. You can click on the links to view the images if you aren’t sure which ones the are:
I like to use the free on-line image editor and Photoshop alternative Pixlr to resize images before uploading them to WordPress.
I also then use WPMU’s WP Smush Pro plugin which will compress the image files on upload so that they can be as small as possible. This plugin isn’t free by any means, but there are some free alternatives.
5. Lazy Loading
Lazy loading is great and a really quick way to speed up your site’s load time. There’s also a great free WordPress site speed plugin called, wait for it, Lazy Load. It’s available on WordPress.org here.
This plugin will figure out what will be on your visitors screen when the page loads and only downloads that content. Then, if and when they scroll down, more content will be downloaded so that it’s ready when it comes into view.
So if only 10% of a page is visible on screen when the page loads, only 10% of the content is downloaded initially and the user doesn’t have to wait for 100% of the content before they can start reading.
4. Caching / Minifying / Compressing
OK, now we get a little more technical. There are a few decent caching plugins to help with WordPress website speed optimization, to name a few:
After A LOT of experimentation with these, W3 Total Cache, or W3TC, comes out top for me every time. While initially seeming very complicated, once you get used to the settings it isn’t so bad.
There are a few types of caching, and some other optimisations that tend to be linked with caching, namely minifying and compressing.
For now, install W3TC and make sure you pay attention to these settings as a priority:
- Page Caching – will probably have the biggest initial impact on page speed. Basically, it generates static HTML files that are served to your visitors rather than having to dynamically generate content, e.g. lists of posts, every time someone visits your site.
- G-Zip Compression – Provided that it is supported by your host / server, this is a setting within the Browser Caching section and is a simple click to switch on. While your there, scan down the list and make sure you are setting expire headers whereever possible.
5. Use a CDN
What is a CDN? CDN stands for Content Delivery Network. I’ll explain how this works by use of an example.
Say my website is on a server in London. If a user in London visits my website, happy days, it should download nice and quickly because it doesn’t have a long way to go. But, say someone who lives in Toronto visits my website, they need to download my images from London. They’ll need to travel around the world.
Sure, the internet is fast, and will it take THAT long? No, but if we’re optimising, then it’s adding unnecessary time to your WordPress website page speed.
When using a CDN, requests for things like images will go through a 3rd party network, who may have a server in, say, Toronto. The first time someone in Toronto visits the site copies of all of the images on a page will be downloaded to their Toronto based server. The second person in Toronto visits your sire, rather than coming all the way from London, the images are now just down the road.
I do love a CDN, so clever, but actually very simple.
Implementing a CDN might seem daunting, but actually there’s a couple of relatively simple options:
- Use CloudFlare – Setting this up could warrent a post of it’s own, but actually CloudFlare are very helpful and provide a lot of supportive documents. They also have a free plan.
- Set up using W3TC – if you use W3TC you’ll notice a CDN section. It will require registration with a 3rd party (I recommend MaxCDN because their customer service is insanely good). Sign up, add the details to W3TC and it will take care of the rest for you.
OK, I’m sure I’ll get a battering for leaving this until last and for what I’m about to say.
Hosting does matter, for sure. To get an indication of how good your hosting is, click on to the Waterfall tab in your GT Metrix results and look at the first line:
This diagram shows a timeline of how long it takes to download everything a browser needs to display your page. You’ll notice that the first line stands all on it’s own.
This is because this is the initial request to the server to get the basic markup of the page, which contains all of the “instructions” of where to get everything else, e.g. images. A browser can’t do anything with this and therefore this metric is important. It’s also known as the TTFB – time to first byte. i.e. the time it took for the browser to receive the first byte of information.
Whilst the quality of your host is not solely responsible for this metric, it is included in there. 55ms is perfectly respectable and this website is not on any specially “WordPress optimised hosting”. Just a regular server that’s been managed well.
Why do I make this point? Because there is a lot of talk about WordPress optimised hosting and how good it is. And while I don’t doubt it has the potential of being the best possible, every time I’ve looked at this in the past I can’t imagine how you could justify the cost VS the benefit.
So, my advice here? Once you’ve optimised the life out of your website, if you are sure that your TTFB has not been slowed by any WordPress configurations or plugins that you could change, then consider looking at your host.
And yes, there’s plenty more…
Like anything else to do with running your own WordPress website, trying to increase the speed of your website is a can of worms for sure. This is just the tip of the iceberg but are the easiest steps to take with the biggest return.
What are your top tips for speeding up a WordPress website?