One of the most important aspects to think about when optimizing your website is speed, or the time it takes to load a page, particularly the homepage.
In fact, some studies suggest that 47% of consumers expect a website to load in two seconds or less, and 40% will abandon a website that takes more than three seconds to load.
If you’ve never tested the load time of your website, chances are very good that it fails the two tests above, perhaps spectacularly.
But this is not your fault, especially if you use WordPress (which I love) and you had somebody set it up for you. While I think WordPress is a great tool for building and managing a website, the fact that it’s so easy to set up creates a low barrier to entry.
What that means is that it’s very easy to call yourself a WordPress developer, even though you may not know (or care about) the necessary steps involved to build an optimized and fine-tuned WordPress site. WordPress out of the box is pretty resource intensive and will run pretty slowly on your typical web host.
Test your site
My favorite speed testing tool is GTMetrix. It’s easy to use, intuitive, and will give you a very comprehensive report on your website’s performance. It includes both Google’s Page Speed metric as well as Yahoo’s YSlow.
Both of these metrics test various qualities that Google and Yahoo deem important, such as caching, image optimization, and compressing scripts and CSS.
To give it a try, just enter your URL in the field and click “Analyze.” Let’s take a look at some common results.
Here’s a good (by which I mean bad) test of the U.K. tourist site This is Your Kingdom. Nice looking website, right? I think so. Yet the speed test is pretty bad, as you can see below.
The first thing I look at is the Page Load Time and Total Page Size, in this case 3.5 seconds and 2.06 MB respectively. Three and a half seconds is too much, and over 2 megs is more than I like to see on a homepage.
Then, if we take a look at the PageSpeed score and recommendations, it’s pretty obvious that this website has some image optimization issues.
First, image dimensions should always be specified whenever possible. This lets the browser know how big the images are, and allows it to render the page much more quickly. It’s a simple thing to ensure is done, but still overlooked a lot of the time.
Second, you can see this site gets a very low score for “serve scaled images.” This is another common problem, especially in the modern days of responsive design where images are resized based on the platform the site is being viewed on (desktop, tablet, phone, etc). This problem is sometimes hard to avoid, but care should still be taken to minimize the issue whenever possible.
Next, we can see the site also scores quite low for “optimize images.” Often, this can be avoided just by installing an image optimization plugin like WP Smush. This plugin will both optimize images as you upload them as well as crunch the images you’ve already uploaded. I would advise against using WordPress without some kind of image optimization plugin, especially if your site is image intensive.
The best way to manage images though is to optimize them by hand or in batches before you upload them to WordPress. You’ll have much more control that way, and you’ll be able to fine-tune both the dimensions and the level of optimization for best results.
What about caching?
So glad you asked. Bottom line, don’t run your site on WordPress without using some type of caching. What does that mean exactly?
In a nutshell, it means that WordPress doesn’t serve a webpage in the normal fashion. Instead of querying a database, putting a set of template files together, building the page and serving it up to your browser, it serves a cached, or prebuilt page instead.
This means that the numerous database queries that tend to slow down a typical WordPress website are eliminated. Instead, a temporary, cached file is created on the server and that is served up in its place.
You might think of it as comparing making a pizza from scratch, cooking and serving it to just popping a frozen pizza in the oven. Much easier and quicker, but without the decline in quality you get with a frozen pizza.
Most of the time caching can be achieved with a caching plugin like W3 Total Cache. In other cases, such as with SiteGround (one of the web hosts I recommend), the caching is built into the hosting environment and needs to be configured there.
Either way, make sure your site is cached and you’ll literally shave seconds off a typical load time. Ignore this advice at your peril.
What to shoot for?
As a rule of thumb, I like to see a homepage load time of less than 1.5 seconds, and I like to see the total page size under 1 megabyte. In these days of ubiquitous broadband connections, more people are using large images and background video to achieve cool visual effects without considering what it costs in terms of speed. Your fancy image slider won’t help you if your users hit the back button before your site can load.
I hope that helps you understand the basics of WordPress optimization for speed. There are a bunch of other tricks you can use, and much has been written on the subject. Here’s a few more good articles.
- 15 Easy Ways To Speed Up WordPress
- How To Speed Up Your WordPress Website
- Speeding up WordPress: How We Optimized List25 Performance by 256%
Best of luck in your quest for a fully optimized WordPress site. And, as always, if you have any questions, let me know in the comments below or feel free to contact me.