Loading
Cancel
Webmail Login
Control Panel Login
Speed up your WordPress website in 6 easy steps
.CO.UK ONLY £5.33
Find your perfect domain here

Speed up your WordPress website in 6 steps

Speed is an important factor, not only in Google's search engine algorithm but for your customers. No one wants to wait for a website to load and let's be honest, with today's technology, why should they? However, all too often, website owners (and even designers) simply install WordPress, pop on a theme and call it a day. Whilst WordPress runs great out of the box, there is so much more you can do to increase the speed of your WordPress site and in turn make your visitors happier.

To help you get the best out of your WordPress website, we have created the below 6 steps that you can follow. If you follow all of them, your site will be running faster than a cheetah with a jet pack.

In the below tests, we will be using a demo site running the popular ZBlackbeard beard.

Step 1 : Choose a good host.

All too often people purchase hosting from a company that has overcrowded or underpowered servers. Whilst these are cheaper (and to be fair, suit their market's need), they are not ideal for getting the best performance from your site. Do your research and check over review sites such as TrustPilot to make sure the host you are going to use can actually provide you with the tools to run a quick website. Once you have found a host, don't be scared to migrate your site. Most good hosts will do this for you free of charge (ourselves included) but if not, here is a WordPress migration guide you can follow.

Step 2 : Get a baseline of your site's speed.

Before you do any optimisation on your site, you will want to know what the base speed of your site is. Without this, you will not know if the optimisation is working correctly. Head over to Pingdom and put your domain name in the URL box. Next, select a test server from the right dropdown that is as close to your location as possible. Then click the "start Test" button.

Pingdom Speed Test

After a few seconds (hopefully!) you should receive your results. In these results, you will see the "load time", "page size" and "requests". These are the 3 main factors that we are going to try and improve over the next few steps.

Results

Before we jump to the speeding up steps, it is important you know what each of the above are.

Load time
This is the total time it takes to load all of your website's required files.

Page Size
This is the total size of your website files. e.g. all your CSS, JS, images and website text.

Requests
Your website will be made up of many diferent files. Each file will need to be requested from the server. For more details on what a server request is, please see our "server request guide".

If you scroll down your results, you should be able to see all the files your website requested in a "waterfall" view. It shows the order they were requested, how long it took for them to be loaded.

Ok, so now we know the basics, let's get to speeding up your wordpress site.

Step 3 : Eliminate any lag in redirecting the site.

When you type your website e.g. http://yourdomain.co.uk into your browser, one of two things will happen. Either A, the page will load or B the page will redirect you to http://www.yourdomain.co.uk (note the www). If it does not redirect you to the www, try entering http://www.yourdomain.co.uk and see if it redirects you to http://yourdomain.co.uk (without the www).

What we are trying to do, is find out which version of your domain (either www or non www) your WordPress website is using. Why, you ask? Well it is quite simple. Whilst WordPress can redirect the user to the correct version, your hosting can do this much quicker. This time delay can sometimes make quite a big difference to your site's load time.

If you look at the screenshot below, you will see that 0.7 seconds is potentially wasted whilst you are redirected to the correct version of your site.

pingdom www redirect

To combat this, we can do a very simple .htaccess tweak.

Open up your hosting control panel and look for your WordPress install (Squirrel Hosting customers can do this via extend control panel > file manager > open the public_html folder). Once you have found your WordPress files, look for the ".htaccess" file. Open this file up to edit (SH customers right click and select edit).

At the top of the .htaccess file, make a new line then add one of the below depending on if you are using the www or non www version of your site.

If your site redirects to www use:

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

If your site redirects to non www use:

RewriteEngine On
RewriteCond %{HTTP_HOST} !^my-domain\.com$ [NC]
RewriteRule ^(.*)$ http://my-domain.com/$1 [R=301,L]

Replace my-domain.com with your domain name.

Save the .htaccess file and then head back over to pingdom for another speed test.

As you can see in the screenshot below, in the demo site we are using for this guide, the redirect time was cut down from 0.7 seconds to 73 miliseconds!

Redirect from www quicker WordPress

So at the end of our first tweak, we have lowered the load time from 1.86 to 1.31 seconds. An impressive cut in load time for such a small change.

Step 1 finished

Step 4 : Use the latest php version.

We won't go into what php is in detail here but in brief it is what your WordPress site will be using to run. Different versions of php exist and the latest version (at the time of writing) is version 7. By default, your hosting with Squirrel Hosting will be set to php 5.3. The reason for this is simply it is the version that most scripts will run with at this point in time. Since we do not know which version you will require, 5.3 is set by default. You can change this yourself very easily (see our how to switch php version guide). If you are not with Squirrel Hosting, contact your host to see which version of php they provide and how you can switch.

WordPress supports version 7 so using the guide mentioned above, we switched the version to 7 and did some more tests. Please note, whilst WordPress may support version 7, your theme or plugins may not. Generally, we suggest starting with 7 and checking your site. If something doesn't work, switch to 5.6, then 5.5 and finally 5.4.

php version change

As you can see in the screenshots, we shaved 0.10 seconds off the load time. Not much of a difference but this is only a small demo site. On a larger site, it may be considerably more.

Step 5 : Caching

Now this is where we start to take some serious chunks out of the site load time. Before we jump into applying caching, it is important to know how caching works. When someone visits your site, wordpress will collect the data stored in the mysql database (such as page text, what plugins to show, what images are needed etc) and only once it is complete, will the page start to render for the visitor. This cycle is repeated each time someone visits your website.

It is not a very efficient procedure. If you ordered a cocktail in a bar and the bartender had to look up all the ingredients to make it, you wouldn't think much about it. However, if someone else then ordered the same drink and he had to look it up again, you would wonder why he could not remember the ingredients. By the 5th or 6th order of the same cocktail, you would possibly be put off ordering that drink again. So why make your website re-work what it already knows?

Using caching means the site collects all the required data from the mysql database once. After that point, all the required data is stored ready for the next visitor. If someone else then comes to your site, they don't have to wait for the data to be collected again (the bartender already has the cocktail made up!).

To acheive this, we will install a free plugin called WordPress Supercache. Log into your WordPress admin and go to "plugins" then click "add new".

WordPRess plugins > add new

In the search box (top right) type in "WP Super Cache" and press enter.

WordPress Super Cache

Click the install now button next to WP Super Cache.

Install plugin

WordPress will now install the plugin. Once complete, click the "activate plugin" link.

Once activated, scroll down your plugin list and click the settings link

super cache settings

If you get the following error:

"Permalink Structure Error A custom url or permalink structure is required for this plugin to work correctly. Please go to the Permalinks Options Page to configure your permalinks."

you will need to enable permalinks. Click the "Permalinks Options Page" link, tick "Post name" then click save. Once complete, re-load the super cache settings page.

Next, turn on the caching by clicking the "Caching On" radio button and then clicking "update status" button.

Turn on caching

This alone, should speed up your website. However, if you are a Squirrel Hosting customer (or use a a different good host), you can tweak this further to increase the speed. Click the "advanced" tab at the top.

advanced caching options

Tick the "Use mod_rewrite to serve cache files." button. Tick the "Compress pages so they're served more quickly to visitors. (Recommended)" box. Then scroll down to the "update status" button and click it.

Use mod_rewrite to serve cache files

The page should now reload and if you scroll down, you should see lots of writing in a yellow box. Scroll to the bottom of this box and click the "Update Mod_Rewrite Rules" button.

Update Mod_Rewrite Rules

The box should now change green with a message saying "Mod Rewrite rules updated!".

Mod Rewrite rules updated!

You now have caching enabled. Head over to your WordPress website to load the page up. The first time it loads will be a little slower than usual (since it has to collect all the data and save it). However, the second time it loads will be significantly quicker.

If we go back to our demo site and run it through Pingdom again, we get the following results.

Speed results after caching

As you can see, we have now cut the load time down to 864 miliseconds (much quicker than the 1.86 seconds on our first test).

Step 6 : Minification.

So we have cut the load time down but the page size is still at 1.9MB and the requests are still at 44. In order for us to get the load time lower, we will need to work on these other issues.

To lower the requests (and slightly lower the page size) we will use minification and combination. This is where some files that are the same type of coding can be combined together and any unneeded characters in the coding (e.g. blank spaces) are removed.

Head over to your WordPress admin and go to plugins > add new. Search for "Autoptimize" then click the install now button.

Autoptimize

Once installed, click the "activate Plugin" link, then click the "settings" link under Autoptimize.

Autoptimize settings

You should now see the Autoptimize settings page. Enabling some of these features may cause aspects of your webesite to load incorrectly. Don't worry though, you can always disable them if something is not right. Tick the following options.
Optimize HTML Code?
Optimize JavaScript Code?
Optimize CSS Code?
Then click "Save Changes and Empty Cache" button.

At this point, all the cache files will have been deleted so you will need to re-visit your site again to re-generate the cache. Once you have done this, jump over to pingdom and re-run a test.

With our demo site, the results were as follows:

Speed test results

Another improvement on speed (now down to 790 miliseconds) and the page size and requests have also both dropped.

So there you have it, when you mix four easy to do tweaks with a quick host, you end up with a very quick website (something your visitors and Google will be happy about).

How much time did you save?

Have you followed the above steps? What was your speed times before and after the tweaks? Let us know in the comments below as we would be interested to see how speedy you made your site.



Leave a comment

Has this guide helped you? Have an idea for a guide or need help? Let us know below.

© Copyright 2014 | Squirrel Hosting Limited
Company Number 9031308