Category Archives for "Performance"

How to minify WordPress HTML, CSS and javascript

HOW TO MINIFY 
WORDPRESS
HTML, CSS AND 

JAVASCRIPT
FILES

Minification is one of those things you'll often see recommended to speed up your WordPress site.

It’s also one of those things that can easily break your WordPress site, causing frustration and headaches for the average WordPress owner.

So what is minification and should you use it on your WordPress site?

What is minification in WordPress?

I didn't know this, but minification is actually a real word. It doesn't show up in many spell checkers but it's been around since the 19th century.

Minification in our context means making a file as small as possible without affecting how it works. It does this by removing all unnecessary content in the file.

Unnecessary content includes

  • Spaces
  • Code comments
  • Formatting
  • Line breaks
  • Carriage returns

Minification usually also includes concatenation, which simply means joining together. If you have fifteen CSS files on your website, these can be joined together into one. Instead of downloading those fifteen files from your web server, a browser only needs to download one. Obviously, this reduces the number of round trips to the server.

The first important thing to understand is that minification is not going to give you the biggest speed gains on your site. Other things will have a much bigger impact than minification on your site, such as

If you haven’t used any of these tactics to speed up your WordPress site, follow the links above and do them first. Then you can come back here and use minification as a fine-tuning tactic.

The best way to understand how minification works is with an example.

How minification works with examples in HTML and CSS

WordPress loads many files to present a single page of your website in a browser. Let’s say one of those files is a HTML file containing the following code (this is for demonstration purposes only so it doesn’t matter what the code does or why):

<html>
​<head>
​<style>
/* styles for front page paragraph */
.front-page { font-size: 120%; }
.front-page { width: 85%; }
</style>
</head>
<body>
<!-- front page paragraph: START -->
<div>...SOME CONTENT IN HERE...</div>
<!-- front page paragraph: END -->
<script>
afunctioncall(); // a call to some function
</script>
</body>
</html>

The code above contains 363 characters, including whitespace.

There are a few things to note about the code above:

  • Comments (in red) are useful for a developer to understand why something was done. But they won’t affect the code meaning and they have no impact on the web page content - they can be removed.
  • Carriage returns and line breaks are useful for the same reason. But again, they're meaningless to your browser - they can be removed.
  • Other whitespace like spaces between characters are again convenient for humans. And again meaningless to your browser - a lot of them can be removed.
  • A smart minification algorithm would notice that there are two lines defining a style for the same element, .front-page. These can be combined.

When we apply what we've noted above to our code, we get the following:

<pre><html><head><style>.front-page{font-size:120%;width:85%;}</style></head><body><div>...SOME CONTENT IN HERE...</div><script>afunctioncall();</script></body></html></pre>

Now the code contains 162 characters, a 56% reduction. It’s less than half the original size.

It’s clear to see that doing this on all the files that make up your website can reduce the size of files to be downloaded by a not-so-insignificant amount. Your web server can now send this minified file to a visitor’s browser instead of the original file.

Benefits of minification

  1. Your WordPress website loads faster for your visitors because only data essential to the web page is downloaded.
    • Your site uses less bandwidth per visitor because less data is transmitted over the network.

What can’t be minified:

Minification is only useful for text based files, i.e. all scripts and style sheets including HTML, PHP, CSS, JS etc.

Images, audio and video files are already compressed. Removing redundant information from them is unnecessary.

It’s also important to note that total minification is not always a good idea. It can break some things on your site, in particular things like image grid layouts and image sliders. For this reason, you should carefully test the level of minification you can safely use on your site.

How to minify files in WordPress

Minify using plugins

Most caching plugins include a feature to minify files. We use either WP Rocket and the relative new-comer Swift Performance on our clients' sites.

There are also plugins specifically for minification but I've honestly never found the need to try them.

Manual minification

Yes, it is possible to minify code manually. For large scale programming projects it can have an impact but this isn’t usually practical in normal web development.

It can be done by

  • Removing unused code
  • Shortening variable names
  • Shortening function names

Of course, this should be done in such a way that the code doesn’t become unreadable for anyone else reading it.

Conclusion

Reducing the size of your web page is an important part of WordPress optimisation. First you should use high-impact techniques like image optimisation and cachingOnce you've done those, minification is a useful way to get smaller speed gains with just a little effort on your part.

Minification is just one of the many items included on our speed checklist that we use on every website we look after. You can download that checklist right here.

​Sources

https://developers.google.com/speed/docs/insights/MinifyResources
https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/optimize-encoding-and-transfer#minification-preprocessing--context-specific-optimizations
https://wp-rocket.me/blog/minification-explained-in-plain-english/

Here’s the real reason you need website maintenance!

why you need WordPress maintenance

Photo by Victor Garcia on Unsplash

Do you want to know the real reason your website is not as safe or as fast as it could be? It’s the real reason you need website maintenance. And it has nothing to do with technology, knowledge or content.

It’s the same reason my garden isn’t the best garden in my neighbourhood, although there’s no reason it couldn’t be.

It’s the same reason my time to run 5 kilometres (3.1 miles) is unlikely to get better than 26 minutes any time soon.

And it’s the same reason I’m completely helpless if my motorbike breaks down on top of some Swiss mountain.

Website maintenance is not what you do

It’s because I’m not a gardener. I’m not a pro runner. I’m not a mechanic.

And the crucial thing is: I don’t want to be those things and that’s okay!

I don’t want to be a gardener. It’s fun and I enjoy learning how to grow my own veggies. But I only want to spend as much time as it takes to get to the point of harvesting those vegetables.

I enjoying reaping the benefits of exercising and feeling fit and healthy. Being fit is good enough for me. But I’m no elite runner and don’t have any desire to be the fastest runner on my block.

I enjoy driving my motorbike through the Alps or the Jura on a sunny day. I enjoy swinging into the corners and feeling the G force when I pull out of that corner with a smile on my face. I can ride the bike pretty well and I’ve never had an accident. But if it breaks down, God help me! I used to be able to dismantle the engine on my 1995 Shadow and put it back together. But it’s all electronics nowadays! I know nothing about modern bike electronics and don’t have any real drive to learn about it.

And that’s all okay! I don’t have to be ANY of those things.

The professionals can help me

Because if I need gardening advice I’ll go to the garden centre. I’ll ask one of their well-trained staff what kind of soil is best for this vegetable or how much water this shrub needs.

If I need advice on fitness training I’ll consult one of the health bloggers I respect. He or she obsesses enough with this stuff to spend most of their time on it. They don’t get caught up in the latest fads; fundamentals are the things that matter to them and that’s why I trust them.

If my bike has problems I’ll call the guy who sold it to me. I trust him. He’s very professional and he’s completely obsessed with motorbikes. That’s why he owns and runs a very successful bike shop.

But if my website speed drops or if I suspect there’s a security gap somewhere?

I’m a wordpress maintenance guy

Then I’ll happily spend hours poking around the server myself. I’ll analyse every bit of data a page loads to see what’s going on. And I’ll happily spend another few hours doing whatever it takes to fix it. I’ll read as much as I have to; I’ll experiment as much as I have to and I’ll spend as much money as I have to to get to a point I’m happy with.

But I’m a trained computer scientist. I’ve worked in that domain for 25 years because I love it. I really want to learn all I can about it. I really want to keep up with the crazy pace of change. I really want to see how far I can push a website to shave another millisecond off its’ loading time!

I do that because I obsess about it. It’s what I enjoy, it’s what I know very well and it’s what I’ve chosen to do every single day. I lie awake at night thinking about how to get a client site loading just that little bit faster (just ask my family!)

Because that’s what I do.

For the other stuff – I hand that over to people who know and care about it well. Finances, graphic design and motorcycle mechanics are some of the things I can’t or just don’t want to deal with. I pay other people to deal with them.

Conclusion

So, what are you obsessed about and spending your time on? Building a business that will genuinely help people and leave you feeling satisfied at the end of every day?

Or are you obsessed about learning the technology so you know exactly how to make your website that little bit faster, that little bit more secure?
If you aren’t obsessed about that, it’ll never be as fast and as safe as it can be.

And that’s okay. You should be obsessed with building and growing your great business. Leave the other stuff to other people.

What do you think? Do you delegate any of your tasks to others so that you can focus on what you do best? Let me know in the comments.

You're not a pro, but you want a super-fast WordPress website anyway?

No problem! This checklist will show how I get load times of 3 seconds or less. Even on cheap shared hosting!

Avoid Bad Requests

Avoid Bad Requests
Photo by Ben Hershey on Unsplash

You’ve seen the “404 Page not found” error message. Annoying, isn’t it?

When a web page testing tool (like Pingdom or GTMetrix ) suggests you ”Avoid Bad Requests” it means one thing: a 404 error or similar.

A 404 error means a broken link. Broken links can ruin your users’ experience on your site. It causes loss of trust and affects your Google ranking.

Here’s how broken links happen and how you can fix them.

What’s A Bad Request?

On the Yoast blog, they say

“too many errors could send a signal of low quality (bad maintenance) to Google”.

That’s not what you want!

A broken link happens when an image or a file can’t be found where the link said it was. This could be a link to a deleted image or file or to one that no longer exists, for whatever reason. Maybe you changed the name or you moved it.

When this happens your web server usually gives a 404 error, meaning the file can’t be found.

Sometimes this is obvious, e.g. when a requested page doesn’t exist. In this case, you’ll get the familiar “404 page not found” error.

But it’s not always so obvious. It can also happen quietly in the background; these are harder to track down.

Where To See Your Bad Requests

Most page speed testing tool will point out these links.

Pingdom

avoid bad requests pingdom
Pingdom finds broken links a.k.a. Bad Requests


GTMetrix

GTmetrix also lists any broken lists it finds

(On the YSlow speed test, part of GTMetrix, it’s called Avoid HTTP 404 (Not Found) error)

Google Search Console

You can also see these errors in Google Search Console, if you use it (and you should) .

How To Fix Bad Requests

Manually

It’s easy enough to fix these bad requests manually. As you can see in the images above, Pingdom and other tools will give the exact URL of the problem.

You’ll need to track down which page is calling that URL and change it or remove it. E.g. you can replace an image with one that works or just remove it. A missing file on another site or in a plugin can be a bigger problem and you might need some help with getting those errors sorted out.

Actually tracking the source of the bad link is easier said than done and can be a problem if you aren’t extremely familiar with your WordPress website. That’s where a plugin comes in handy.

Use A Plugin

A plugin is useful when you need to clean up these links. I use the Broken Link Checker plugin. It’s particularly useful when cleaning up a new customer site but I don’t typically leave it installed once I’ve cleaned up the links.

Once installed, the plugin scans your pages and compiles a list of all broken links found on your WordPress site. These can be found from your WordPress Admin dashboard under Tools > Broken Links.

The best part about this is that the plugin tells you where the file is linked to, in the Source column. So you can go straight to the problem page to fix it, no guesswork involved.

oken Links Checker shows you the source of the bad request

Conclusion

Lots of broken links around your WordPress website is an indicator of poor housekeeping and can mean a poor experience for your visitors; think how often you’ve backed up from a website that gives you a 404 error or shows blanks where images should be.

But if you fix them

  • your visitors will be happier.
  • Google will be happier.
  • Your page test scores will be better.
  • And as a bonus, your site ranking will be better.

How do you typically deal with broken links on your site?

How to fix minimise redirects

Photo by Paweł Czerwiński on Unsplash

As a conscientious site owner you no doubt work regularly on speeding up your WordPress site. At least, you should!

If you do, you'll be familiar with Pingdom's speed testing tool.

One of the common and trickier insights from that test is the Minimise redirects problem.

minimise redirects

I’ll explain what causes this problem and the steps that will fix it forever ...

What Causes A Minimise Redirects Error?

A redirect happens when a page on your site causes another page to load instead. 

There are some common reasons for redirects on your site, both accidental and deliberate.

SSL certificate

Redirecting http:// to https:// 

Non-WWW (or vice-versa)

Redirecting www.yoursite.com to yoursite.com (without the www subdomain) 

Updated Post

Maybe the URL of the page has changed e.g. if you changed a post title or changed how your permalinks are builtMaybe you have an old post that’s outdated and you rewrite a newer version of that post.

You may want to redirect the old post to the new one. This way you keep the SEO benefits of the old page and give visitors the newer, more relevant information on the new page.

For these redirects, many active sites use a redirect plugin like Redirection. https://wordpress.org/plugins/redirection/With these plugins you intentionally direct a browser from one page on the site to another. 

WordPress' "Smart" redirect

WordPress itself also has some redirection built in. e.g. On my site I have a page at https://wpstrands.com/about/faq. If someone types this URL incorrectly as https:/wpstrands/faq, WordPress is smart enough to cause a redirect to the correct URL.

Site Changes

Another way a redirect can happen is when you make some structural changes to your site. Maybe you've added an SSL certificate or rename the site. Your database can accidentally contain some old URLs, so redirects will be needed for the correct page to load.

Poorly formed links

Another example of an unintentional redirect is if you create links on your page or post (or a custom menu item) to your site using an incorrect URL. E.g. to http:// instead of to https://.

Each of these links need to be redirected to the correct URL version.

Are Redirects good?

Any of these redirects could have been set up by you, your developer or by a plugin you have installed on your site.

These redirects can be a good thing, of course, but it’s important to know that they do have an effect on your page load time.

An example

Lets take a look at the result of a Pingdom test on this site, WPStrands. My site uses SSL and I’ve set it up to be at the address without the leading www, i.e. at https://wpstrands.com

The site can be reached by any of these URLS:

  • https://wpstrands.com
  • https://wpstrands.com
  • https://wpstrands.com
  • https://wpstrands.com

If I run a pingdom test for https://wpstrands.com, this is the result:

pingdom test good url

Not too bad! Further down the test results page we can see the files that are loaded:

pingdom test good url files

Note that it loads the site in one go, no redirects.

Now look what happens if I run the test on my site using the URL https://wpstrands.com

pingdom test bad url
That's a bit slower, and there are even a few extra requests!  What happened?

The answer is revealed further down in the file requests section ...

pingdom test bad url files

This time, you can clearly see that the URL given is redirected twice. First, from the http version to the https version of the site. Secondly, that URL then redirects once more to the non-www version of my site.

These redirects take time and this means a longer load time for the page. It doesn’t look much but in my case above, this is an increase in page loading time of 17%!

Now that won’t have much impact on this fast site.

But on a larger, slower site it can make a huge difference in how your visitors experience your load time. And, of course, in how Google rates your site.

Your loading time can be as much as 60% longer with these additional redirects!

Check your site-level redirects

A good tool to help you see your site redirects is this one. Just enter your URL and hit go. The Goal is to have no more than one redirect, no matter what the inputted URL is.

How to fix it

On the webserver

On most WordPress hosting, Apache is the web server running your site. Adding redirects to your .htaccess file will solve the problem of redirects like http to https and www to non-www. 

E.g. to redirect www to non-www, you need this rule.

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

Consult your host to find out exactly what rule you need to add and where.

(On more advanced hosting, you might be using NGINX as a web server, in which case you won’t have a .htaccess file. Again, you’ll need to contact your host to make the redirects.)

In the database

Just to make sure, you should also check your database for errors.

You can do this directly in your database, but that’s prone to error.

You can run a script on your database but that’s very technical and also prone to error.

The easiest way to solve this is with a plugin like Better search replace. You can run a search and do a dry run (making no changes) to see if there are any incorrect URLs still lurking in the databse.

Creating Links

Finally, get into good habits when creating links on your site. Use the proper prefix HTTP or HTTPS, use the proper subdomain www if your site uses it and include the entire path to any pages in the link.

Conclusion

Now your site should be faster and you should have one less Pingdom problem. 

Redirects are sometimes needed but they do slow down your site.  Use them correctly to minimise their speed impact and you won’t have any problems with Pingdom or other speed testing scores.

Did you have any problems with the above? Let me know in the discussion ...

Introduction to the Pingdom waterfall chart

Pingdom waterfall chart

An understanding of the Pingdom waterfall chart can help speed up your WordPress website. Here's how to use it for yours.

What if you had a way to spot exactly where your WordPress website is loading slowly at a glance.

What if you could see exactly what you could do to speed up your site in just a few minutes?

Reading a Pingdom waterfall chart doesn't sound like the best way to spend your precious timeBut what if you took a little time to understand what that technical chart means for your website?

It would mean a much deeper understanding of what's going on with your site. And most importantly, being able to improve it so that Google and your visitors are happier.

What’s a Pingdom waterfall chart?

A waterfall chart in the context of a website speed test is simply a visual representation of your web page as it is loading from start to finish. It shows what loads, when it loads and how long it takes.

Contrary to popular belief, you need no expertise to understand the Pingdom waterfall chart. And you need no expertise to see where you can use it to speed up your WordPress website.

The best part is that a waterfall chart can show you exactly what is slowing down your site.

Here’s an example waterfall chart for an average WordPress website.

waterfall for average wordpress site

At the top there is a time scale in seconds, beginning at 0 (the start of page load) and continuing to the right when the entire page has finished loading.

There is a row in the chart for every element of the web page that has to be loaded: images, CSS files, script files, fonts from Google etc. A coloured block is shown for each of these resources at the time it starts to load. Obviously longer blocks mean longer loading time.

The ideal site would have fewer rows and smaller blocks for each row, something like this:

a good waterfall chart

Some of these blocks could be better but note that the page has only 12 requests, is only 364 kB in size and loads in less than a second!

I’ll explain what each part of the chart means and how you can use it to improve your WordPress loading time.

Where to see a waterfall chart

Most website speed testing tools will show a waterfall representation of your website page loading time.

I'll use Pingdom's chart as an example because it's free, fast and one of the most widely used speed testing tools..

What The Waterfall Chart Colours Mean

Here’s a description of what each colour means from Pingdom themselves.

  • DNS Web browser is looking up DNS information

  • SSL Web browser is performing a SSL handshake

  • Connect Web browser is connecting to the server

  • Send Web browser is sending data to the server

  • Wait Web browser is waiting for data from the server

  • Receive Web browser is receiving data from the server

How A Waterfall Chart Can Help You Increase Site Speed

Each part of the Pingdom waterfall chart can point you to different areas for optimising your overall WordPress website speed.

Pink: Web browser is looking up DNS information

DNS (Domain Name Service) is the internet equivalent of a telephone book for websites. This portion of the waterfall chart shows how long it takes to look up your internet name and find your IP address.

This shows how long it takes DNS servers to respond the first time a visitor visits your site. 

A lot of people misinterpret this part: Pingdom does a fresh lookup the first time you run a test. If you run the test again, this lookup is cached (saved) so that it doesn’t need to be run every time. Thus, a second and third test on the same site may show a faster time for this DNS lookup. (In the example chart above, the pink clock in a second test would be negligible.)

DNS lookups also include looking up any sites that your site loads scripts from. So if you use Google Analytics on your site, that site must also be looked up before anything can be loaded on your page.

Purple: Web browser is performing a SSL handshake

If your site URL begins with HTTPS, you're using SSL (secure socket layer).

SSL encrypts traffic to and from your website and you should be using it. This negotiation takes a bit of time but these days that time is usually not substantial.

Blue: Web browser is connecting to the server

This is the time it takes to make a connection to your web server.

The main takeaway from the Connect portion of the waterfall chart is that on a slow web server this blue bar will be significant, meaning your web server is probably slow. This is one good reason to use good hosting like Siteground.

Yellow: Wait Web browser is waiting for data from the server

This is the time it takes for data to get from your server to your browser. Generally a wait time of 100ms is good; anything over 400ms is slow.

This could mean that the particular resource is big and takes some time to download. It could also mean that the transfer speed of your web server is slow. If it's the latter, it’s again time to think about upgrading to a better host.

A CDN (Content Delivery Network) will also be of obvious help here since it will deliver the data from a server nearest your visitor. Using a CDN like the one we offer has reduced this wait time for our customers by 70%!

In our example above, we can clearly see that there's a long wait time from the very beginning. A look at the chart further down gives us a huge indicator of what can be improved for this site:

waterfall chart example 2

All those long yellow blocks? You can see from the file names that they are mainly images being downloaded.

Orange/Green: Web browser is sendingreceiving data to/from the server

This is where you can make the easiest changes to your website speed. A large image file will show a longer green bar than a small file. So, optimising your images is a great place to start. This is particularly important as images now make up 70% of the average web page.

Again, using a CDN will help a lot here since the download will be from the server nearest your visitor.

Other important measurements

At the bottom of the pingdom waterfall chart are some important metrics:

important waterfall metrics

Total number of requests

This is the number of times the browser asks the server for some data. Clearly, less requests will be faster.

You can lower the number of requests by using a good caching plugin like WP Rocket to download a bunch of files at once. The plugin can gather all your HTML, CSS or Javascript files into a single file (concatenation).

Total page size

Google recommends an overall web page size of less than 500Mb. The average is 1.8Mb. If yours is bigger, find ways to reduce it. For most sites, dealing with image optimisation is a great place to start.

Total load time

Google's recommended time to fully load your page is under 3 seconds. The average? About 8-9 seconds!

Clearly you can endear Google to your site by getting below this average and closer to the ideal.

Conclusion

Don’t be scared of Pingdom’s waterfall chart: it’s a simple tool anyone can use to make a great start at increasing your WordPress speed.

As always with speed testing tools, it's important not to get obsessed with the overall score.  More important is that you can make improvements over time i.e. the general trend is toward a faster WordPress website.

(Beyond the basics mentioned above, we use the Pingdom waterfall chart regularly to dive deep. With it we can investigate bottlenecks caused by individual resources. Finding a new way to load even a single file can have great benefits to a site's appearance in search results.)

Sources

https://kinsta.com/blog/pingdom-speed-test/
https://tools.pingdom.com/
https://www.keycdn.com/blog/waterfall-analysis/#1-DNS-Lookup-DNS
https://www.machmetrics.com/speed-blog/average-page-load-times-websites-2018/

Setup Cloudflare Free CDN With WordPress

If you need more speed for your site and you just don’t have the budget for a premium CDN service, why not try the Cloudflare free CDN with WordPres? It takes just minutes to set up and you’ll get a speed boost without doing anything else.

Following on from my last article on the benefits of using a CDN with your WordPress website, today we’ll look at how to set up the free Cloudflare CDN.

First, Run A Speed Test

Before making any attempt at speeding up your website, it’s useful to have something to compare it to. Since every site is unique there is no guarantee that what will work for my site will work in the same way for yours.

Running a speed test will give you an idea of what speed changes were made, if any, after you setup the Cloudflare free CDN with WordPress.

Simply go to tools.pingdom.com and enter your site’s URL to run their test.  It’s wise to do this several times as speed is a variable metric.

For more infgormation on measuring your WordPress site speed see 
How to measure the speed of your wordpress website

Could Your Hosting Be Better?

Bear in mind that if your website is running on cheap shared hosting, your speed gains even from a CDN might be minimal.  We always recommend Siteground (#1 in this poll and this poll) for great WordPress hosting and they are a Cloudflare partner which means free CloudFlare is included. They also include a free SSL, as any good host should these days.

Create A Cloudflare Account

First you need an account with Cloudflare.

Go to https://www.cloudflare.com/ and click on Sign Up

Fill in the form and click Create Account.

(I know hardly any one does it but you should really read the Terms of use and make sure you are okay with Cloudflare doing whatever they want with any data you share with them. Just saying … )

Set Up Your Website In Cloudflare

Once you’ve created your account you will be asked to enter your website URL.

Cloudflare will automatically scan your site’s DNS records.  Don’t worry about this technical-sounding step. DNS contains the names and addresses used to reach your website. Cloudflare needs  to know these to divert your traffic to their servers so that they can secure and speed it up.

Select your account – choose FREE and confirm

Now you’ll be presented with the DNS scan results. You need to double-check these results are correct.

The easiest way to do this is to log in to your hosting account and view your DNS settings there – they should match what Cloudflare found.

Finally, Cloudflare will give you the names of the new name servers you need to use to divert traffic through their servers.

Change Your Website’s Name Servers

The final step is to direct all traffic going to your website through Cloudflare.  You do this by changing your website’s Name Servers in your hosting account. I’ll show you where to change it in GoDaddy, Namescheap and any account that uses CPanel.

Change Name Servers In CPanel

For accounts using CPanel, click on Domain Manager

Select the domain you want to change and click Custom Name Servers, then enter the new name servers given by Cloudflare.

Change Name Servers In Namecheap

List your domains, click Manage, select Custom name servers and enter the new name server there.

Change Name Servers In GoDaddy

In GoDaddy accounts without CPanel you go to Domains, click on the domain you are adding the CDN to, then click Name Servers

Wait For DNS Propagation

The changes you’ve just made need to be copied to all name servers all over the internet. This can take up to 24 hours but is usually done in about 6 hours. You can check to see how far the changes are going at Whatsmydns https://www.whatsmydns.net/

Check Your Speed Again

Now you’re done you need to see if anything has actually changed for the better for your WordPRess website.  Did setting up the CLoudflare FRee CDN on your WordPRess site actially do anything?

Run the same speed test you ran above (again, several times to get an average) and hopefully it’s noticeably faster.

Conclusion

So there’s not much to setting up the free Cloudflare CDN on your WordPRess website. The above steps can all be done in a few minutes.

Of course, a CDN won’t fix all your WordPress speed problems. You need to cover all the speed optimisation basics as well, starting with good hosting.  Check out our other articles on website speed on the blog.

And if you really want to go deeper, get the very optimisation checklist we use here at WPStrands to get your site as fast as possible!

Should you use a CDN with WordPress?

Imagine you live in the USA and you visit a WordPress website in Australia. The website’s server has to send every file for that web page from Australia to your browser in the US. That includes all image files, video files etc. Transferring data these days is fast, but it’s not instantaneous. As you can imagine, that downloading takes some time.

Now imagine you visit the same website again. But this time every file you need to download is sitting on a computer in a warehouse down the street from you. Clearly, the download would be faster, the website page would load quicker and you’d have a much more pleasant experience on that website.

That’s what a CDN does.

By now you must know that it’s all about speed on today’s web!

Next to choosing quality hosting, using a CDN will do more to improve your website speed than anything else.

That’s a grand claim, so read on to see what a CDN can do for you …

What Is A CDN For WordPress?

A Content Delivery Network is a network of servers (computers). It stores and delivers your WordPress website content to your website visitors.
The main purpose of this CDN is speed. The power of a CDN comes from the “Network” part of its name. This network of servers is typically distributed around the globe. All visitors to your site, wherever they are, will automatically use the server nearest to them.

NCDN - CDN

(Left) Single server distribution | (Right) CDN scheme of distribution

Image by Kanoha [CC BY-SA 3.0 (https://creativecommons.org/licenses/by-sa/3.0) or GFDL (http://www.gnu.org/copyleft/fdl.html)], from Wikimedia Commons via Privacy Canada

As you can imagine this will give you a much faster page load experience.

A nice side-effect of having multiple servers with the same content is resilience. If any server is hacked or if it malfunctions, other servers can take its load. Thus a CDN has the added benefit of making a website more resistant to hacking attacks!

A Bit Of CDN History

CDNs came about due to the increase in multimedia use online. Larger video and audio files need more bandwidth. Companies started to use distributed servers to ease the bandwidth load on their main server.

As is typical, this technology has become more affordable and more available. Now anyone with a WordPress website can benefit from using some form of CDN.

How Does A CDN Work With WordPress?

A CDN consists of many computers around the world. Some of your WordPress content is stored on these computers. This includes any files you upload to your site such as images, audio or video.

When someone visits your website, their browser requests to download files for a web page e.g. an image. The CDN directs the browser to the computer nearest to the visitor. This end result is a faster load time for that visitor.

Only static files are stored on the CDN. Static files are those that do not change every time the website is loaded. Think images, videos, audio, maybe even HTML and CSS.

Dynamic files, such as the HTML of a blog page, are built each time the page loads so they will be sent from the original web server.

Static files tend to be the largest files on your site. By bringing those files nearer to your visitors you guarantee a faster experience for them.

 

 

Do I Need To Use A CDN With WordPress?

Since speed is such a huge factor on the web these days, more and more people are considering a CDN as an essential part of their WordPress setup.
But it does come with a cost.

There’s a financial cost (if you don’t use a free CDN service) and a time cost for setup and management.

In the end, it’s entirely up to you as the website owner. How serious are you about your site? If it’s a hobby site with low traffic then maybe a CDN is overkill. But for anyone serious about growing their online business, a CDN is now almost mandatory.

Until a year or two ago, my own feeling on this was that paying for a CDN was unnecessary for most WordPress site owners. Most of those sites have low traffic and I viewed a CDN as something to ease bandwidth usage on high traffic sites.

Since then, however, I’ve changed my mind completely.

CDNs usually offer much more than a speed boost. e.g. Cloudflare also offers some basic security protection. The web application firewall that comes with our own plans at WPStrands also includes a fantastic CDN.

(I like to play a little trick on new customers. We don’t mention the CDN aspect of our firewall very much. So when we install the firewall, customers are amazed at the dramatic speed increase on their site! It’s nice to see the emails coming in with comments like “Wow! What have you done!? My site is flying”.)

Today, WordPress speed is more important than ever. WordPress security is more important than ever. How convenient that a CDN can help on both counts!

Once I started using a CDN, I was so impressed with the benefits that I couldn’t imagine not using one. I now think anyone serious about their online business should use one.

Where to get a CDN for WordPress – the options

Photo by Annie Spratt on Unsplash

As with most services like this, there are a huge number of offerings when it comes to CDNs. Both free and paid versions exist.

The easiest way

The easiest way, of course, is to sign up to one of our plans and let us do everything for you.

Both our Entrepreneur and Business plans include the excellent Sucuri website firewall/CDN combination. Those plans include full backups, updates, speed and security optimisation. It’s perfect if you’d prefer a hands-off approach to your website technology.

The free way

Jetpack

If you’ve used WordPress for any length of time, then you’re familiar with Jetpack.

Did you know that it includes a free CDN, called Image CDN? Although pretty limited, it could be a great way to try out a CDN for your basic WordPress site.

Cloudflare

Cloudflare believe everyone should have the benefit of a CDN and is probably the most popular free option out there.  See more in the following section.

Incapsula

Incapsula have a generous free plan with basic security which is easy to set up, though I haven’t tried it yet.

Bigger Players

If you want to go with the big cloud players Amazon AWS, Google Cloud and Microsoft Azure all also offer free services for up to a year. This is more than enough time to test if it’s for you or not.

The Paid Way

I’ll just briefly mention some of the big players in the CDN arena. They’re professional services with great support – a must-have when adding this kind of complexity to your technical setup.

Among the largest players are

Sucuri

This is what we use and what we recommend if your site doesn’t have extremely high traffic. For a very low cost, you get the excellent Sucuri firewall and the CDN included. You get the best of both worlds: speed and security!

We include Sucuri in both our Entrepreneur and Business plans.

MaxCDN

Highly regarded in the WordPress space, MaxCDN offers what they call “stacks”; you purchase different functions such as a CDN, a Firewall etc. as you need them.

Cloudflare

Cloudflare is probably best known for providing free CDN services. Keep in mind the free service is pretty basic and the security aspects are limited compared to a low-cost option like Sucuri. But if you want to use a CDN with WordPress, this might be the best place to start.

Cloudflare’s CEO Matthew Prince says they will always offer a free version.

KeyCDN

Another highly respected CDN provider, KeyCDN offers pay as you use plans. This is great for smaller individual sites but you should be aware that a spike in traffic could cause those costs to jump suddenly.

The DIY way

I’ll have a separate post on how to set up Cloudflare free CDN by yourself coming soon. In the meantime check this post from Cloudflare themselves.

If you use a caching plugin like WP Rocket the setup is even simpler.

If you decide to pay for a CDN, I would advise you to get one that includes other useful services. This is why we offer the Sucuri firewall in our plans. As well as getting industry-best security protection, It includes a very impressive CDN that never fails to astonish customers when we install it and it starts to boost their site speed.

An Alternative Way

I’d be remiss not to mention an alternative if you’re somewhat technically inclined.

You can opt to use free cloud storage to serve your static WordPress content instead of serving it from your own web server. Obviously, this means your server has less work to do and it uses less storage space. But it takes some fiddling around with how your content is set up in WordPress to pull this off.

This post from Kinsta goes through some of the options.

Conclusion

Now you know what a CDN is and how it gives your website visitors a better experience when visiting your WordPress website.

While adding a CDN to the list of technologies you use for your business can seem complicated, there are free and low-cost options. Keep in mind they do add complexity to your setup and with that comes the need for extra technical skills or extra support.

If you need to know more about how we can significantly boost your WordPress website speed with our CDN, or how we can help you use a CDN for WordPress, drop us a line.

How to Clean your WordPress Database

How to clean your 
WordPress database

Photo by Roi Dimor on Unsplash

Do you know how to clean your WordPress database?  Did you know that you needed to clean it up at all?  Well, here's all you need to get started.

I once drove around Australia in a 20 year old VW Combi named ALA with my brother.

We were very smart before setting off from Melbourne; we cleaned her out and fixed whatever needed fixing.

We had the upholstery repaired and the seat belts checked.

She got new tyres and working lights. We fixed the bed, the fridge and the roof popup.

We even gave her a nice new coat of cyan before we got underway.

combi all cleaned up and ready to go. or is it?

All cleaned up and ready to go. Or is she ... ?

There was just one thing we didn't do. We didn't get anyone to check under the hood. We'd no idea about the state of the engine and I think it didn't even cross our minds.

Being superficial just isn't good enough

She lasted us well, getting us (and the frequent taggers-along) from Melbourne all the way up the East coast, across the Queensland outback and into the middle of Australia. We almost made it up to Katherine in the Northern Territory - about 8,000 km!

But then she started leaking oil. In the middle of the outback, we'd no idea what to do. We bought used oil and kept her filled up but it wasn't enough. She leaked faster and faster until we couldn't keep her topped up fast enough. With just a few days to go to Darwin she decided enough was enough and suddenly froze. The engine seized.

We were left sitting on the side of the highway. In the blazing sun. In the middle of nowhere.

So we brewed a cup of tea and put our feet up. That was life back then; not too many cares. 

Of course, we should have looked a bit deeper under the surface when we were polishing ALA before our trip! I'll fill you in on what happened with ALA at the end of the post ... 

A lot of people make the same mistake with their WordPress website's database. In fact, I'm betting you don't know the size or the state of your database right now.

This post will show you the basics of how to clean your WordPress database; that all-important engine of your WordPress website.

Why you need to clean your WordPress database

Your WordPress website has two main software components: the files and the database.

The files are the PHP, HTML, CSS and JavaScript files that live on your web server.

The database is usually MySQL, an open-source Relational DataBase Management System. WordPress, themes and plugins all use this database to store your posts, pages, comments and all sorts of settings for your site.

wp&MySQL

As you can imagine, this database gets used quite heavily.

WordPress uses it any time you change a page, a post, a comment or a setting anywhere on your site.

In fact, WordPress uses your MySQL database every time it loads a page on your website.

If HTML is the chassis, CSS is the fairing and PHP is the engine, then you can look on the database as the fuel of your WordPress website.

Database problems from Plugins

When you deactivate a plugin, it will leave its settings intact in your database. This is so that you don't need to go through all the settings when you re-activate that plugin. If you want these settings removed, you will need to delete the plugin; that's the difference between deactivating and deleting a plugin.  Deleting will remove the plugin files and save you space that way. But will deleting a plugin also clean your WordPress database?

Unfortunately, the answer is no. Some plugin authors have decided to leave their plugin settings intact in the database, even after you delete the plugin. This is in case you ever reinstall the plugin.  These authors think they are helping you by making this decision for you but, in fact, it's poor programming and poor cleaning up.

As a result of this enthusiasm of theirs, you can get lots of “orphaned” results left lying around various places in your database. The options table in your database is one such place. Naturally your database will grow in size if these orphaned bits of data are never cleaned up.

Database problems from Transients

In WordPress terms, transients are just like options expect they have an expiry date. Transients are a form of caching that takes place on the server side. Because of this, they are a good choice for storing the results of remote calls. e.g. to a third party site.

Transients aren’t all problems. They might still exist in the database because they haven't yet reached their expiry date. Lots of them, though, can be left lying around longer than needed. Another cause of your database size increasing and another reason to clean your WordPress database.

Does database size matter?

This is another of those "it depends!" situations.

It depends on what your web page needs to look up each time it’s loaded. Here's a simple way of looking at it:

If your site uses a lot of plugins that do a lot of things in your WordPress database, then yes, your database size will matter.

For example, the WordPress options table gets loaded on every page. So if this table is big, then of course it will influence the loading time of every page.

On the other hand, your web pages might be simple and might not use many database look-ups. In this case the size probably doesn't matter.

Most people will never know nor care how their database is being used and that's fine.  In general, though, it does no harm to keep your database clean, shiny and fast.  Luckily there are easy ways to do that.

How to clean your WordPress database

You have a couple of options to clean your WordPress database: manually or automatically.

Clean your database by hand

Thinking of cleaning up your WordPress database by hand?

First, of course, TAKE THAT BACKUP!

Second, forget about cleaning up your database by hand.

Seriously.

It takes time. It's highly prone to error. Any mistake in here has the potential to destroy your site.

So, my advice is ... "don’t bother."

Unless you LOVE tinkering with the innermost workings of your website. And of course it’s also the only way to really make sure you are deleting exactly what you want.

But even I do this on very rare occasions and for very specific problems.

Most times I just use a plugin.

Clean your database with a plugin

None of these plugins will do a perfect job i.e. deleting everything it could delete and leaving everything it should not.

But they will do a good job.

As with ANY thing to do with the database - do this with care. Don’t blame the plugin if it does something you don’t understand. (Remember ... take that backup!)

WP-Rocket

This is our caching plugin of choice at WPStrands for a host of reasons. And as a bonus it can also clean your WordPress database! The options for database cleanup aren't very advanced and include the most common areas of database bloat so it's relatively safe for beginners. (But always, always take that backup.) 

Did you know that you get the premium version of WP-Rocket free with our Entrepreneur and Business plans?

WP-Optimize

It's hugely popular, it's well maintained and does a pretty good job. Some people critiscise it since it doesn't follow the WordPress way of deleting things. It uses direct database queries to remove stuff, instead of WordPress functions. Because of this it can and does leave some things behind that it shouldn't.

WP-Sweep

Not as popular as WP-Optimize, but it has it's fans because it uses WordPress delete functions and not direct MySQL queries. In that sense it is a better coded plugin in WordPress terms. So it has a better chance of ensuring WordPress stuff is properly cleaned up. Note the author says it is not compatible with Meta Slider

Optimize Database after Deleting Revisions

Another popular one. This one has the added bonus of being able to keep revisions for specific posts/pages.

WP Clean Up Optimizer: Optimize Database & WordPress

Also pretty popular, has good ratings and appears to work well.

Advanced Database Cleaner

Another one that seems to do exactly what it says on the tin.

Prevention is better than cure

I favour the "stitch in time saves nine" approach.

Having to clean your WordPress database shouldn't be a massive job every time you get around to it. Here are some easy things anyone can do to minimise database bloat.

How to manage your WordPress database size

Delete unused plugins

When you’re trying out a few different plugins to find one you like, it's tempting to install half a dozen plugins, try them out then uninstall them again.

This is too easy to do.  Plugin data and settings are stored in the database. I also mentioned earlier that some plugins can leave orphaned data behind. This is more common than you think. If you aren't choosy about the plugins you pick at this stage it's a certainty that you'll have litter left in your database.

​Moderate comments & Delete Spam regularly

These are also stored in the database. Make sure you go through your comments regularly.

Post revisions

This is a huge one!  A lot of people aren't aware that every time they edit a post or page, WordPress saves a copy.

This means you always have every version of your posts. It also means this is a major cause of database bloat! I regularly see hundreds of post revisions in the websites I clean.  Most of the plugins mentioned above will delete all those unwanted revisions.

Fortunately, you can set the number of revisions you want to keep stored in your database.  Do this through your site's wpconfig.php file. FTP to your site as per these instructions and edit the file.

Insert this code above the line /* That's all, stop editing! Happy blogging. */

define('WP_POST_REVISIONS', 4); /* save up to 4 post revisions */

Of course, there’s also a plugin for that: https://wordpress.org/plugins/revision-control/ though I've never used it.

We do all of these tasks regularly as part of our regular maintenance plans at WPStrands. Here's some more advanced stuff that we also do:

  • ​Optimize your database
  • Change your database prefix for advanced security

Conclusion

For such a heavily used part of your website, the WordPress database is often overlooked by site owners. That's understandable since it's highly technical and to be honest, scary to touch.

But, it's essential nonetheless- don't ignore the fuel source of your WordPress website! If you do, you'll be stumped by the strange happenings when it gets big and bloated.

And, in case you were wondering about ALA? Within thirty minutes at the side of the road a guy stopped.  He and his girlfriend towed us for two days to Darwin! We sold ALA for a few hundred dollars to a guy in a campsite. He probably knew exactly how to free up that engine and get her running again.

Us? We bussed it all the way back to Melbourne... it was nice to put our feet up and be driven for a change after all that driving!

Sources

https://www.pixemweb.com/blog/wp-optimize-vs-wp-sweep-vs-optimize-database-vs-advanced-database-cleaner/
https://wptavern.com/orphaned-tables-created-by-wordpress-plugins-are-not-necessarily-a-bad-thing
https://stackoverflow.com/questions/1276/how-big-can-a-mysql-database-get-before-performance-starts-to-degrade
https://wordpress.stackexchange.com/questions/81912/relationship-between-performance-and-database-size
https://scotch.io/tutorials/a-guide-to-transients-in-wordpress
https://css-tricks.com/the-deal-with-wordpress-transients/
https://pressjitsu.com/blog/transient-cache-alternatives/

https://codex.wordpress.org/Options_API
https://codex.wordpress.org/Transients_API
http://www.wpbeginner.com/plugins/how-to-clean-up-your-wordpress-database-for-improved-performance/

Introduction to WordPress caching for beginners

Introduction to WordPRess caching

A beginner’s introduction to WordPress caching

The best introduction to WordPress caching I've ever heard goes something like this:

Me: "What’s 1,234,567 divided by 9,721?"

You: "Er, no idea ..."

At this point you take out a phone or calculator and work out the answer.

You: "It's 127!"

Me: "Once more, what's 1,234,567 divided by 9,721?"

You, immediately: "127!"

That’s exactly how caching works.

Caching explained

It's pretty obvious how it works for the example above; you've already done the calculations and worked out the answer.

It's now in your head.

When I ask you the same question again, you need to spend no time working it out or calculating anything.

You can serve the answer up to me right away.

But, how do we put the above example into the context of browsing the internet?

The problem with WordPress page loading speed

Here’s a very basic example of how a website gets from its web server to appear in your browser:

A web server request

My browser wants to load the page above, so it asks the web server, can I have this page, with this image?  The server answers, yes, and the image is downloaded over the internet to my computer, where my browser loads it into view.

Actually, this request happens dozens of times for each web page; multiple requests are sent to get all the text, images, scripts and other files needed to display the page properly. (Reducing the number of these requests is obviously another area you can speed up your website.)

To show how often this back and forth happens, here's part of the load sequence for this very webpage. You don't need to understand it. Just note that each row represents something being requested from the server.

Now, when the next person comes to my website and lands on this page, they need to go through that whole process again.  Their browser needs to send each and every request to the server, one by one.  And the server answers each request, one by one.

The same for the next person. 

And the next.

WordPress caching to the rescue

This is where WordPress caching comes in.

When the first person comes to the page, the final rendered page sent to the browser is saved, or "cached" on the server (from French "cacher", meaning "to hide").

Now, when a second person arrives at that same web page, the page doesn’t have to be rebuilt from scratch. The server checks it’s history and realises “oh, I’ve already built this page for someone”.

It can just send out that saved version to the next visitor.

And to the next. And the next. 

It’s just served up from the cache and sent out.

Obviously this means it’s faster. Much faster. Except for poor visitor number one who does all the work.


Now, in reality, caching is much more complex. Usually there are multiple levels of caching happening at once. Typically your browser does some caching on your own computer.  

WordPress itself can also do some caching without a plugin.  

If you use a CDN that might also use it's own caching.  

My Sucuri firewall does caching, too.

And let's not forget the multitude of caching plugins for WordPress, each with their own unique way of doing things.

Problems with WordPress caching

The more astute of you might have noticed a potential problem with this approach. What if the website page changes at any point? Won’t that mean the cached version is out of date?

Yes, it will mean exactly that.

The single biggest problem with caching is that you might get an out of date version of the website page you visit.

If you’ve ever edited a web page and checked it in the browser only to see the old version, this is most likely what’s happening.

The more complex the caching used on your website, the tougher the caching problems you can come across.


Help with caching problems

Some browsers are more stubborn at caching than others, refusing to serve up the latest version of that page. 

To that end, here are some things you can try to get the latest version of your website page 

  • Try holding down the Shift key while pressing the Refresh button
  • Clear the cache via plugin settings. There are thousands of articles online on how to do this.
  • Close your browser and re-open it
  • Use an alternative URL for the same location. For example, if you are going to www.yourdomain.name, you might go to your IP address instead. (You can find your IP address from your hosting). 
  • Use a different browser (if you use IE, try Firefox, and vice versa).
  • Make sure your plugin is set to clear the cache any time a page is updated
  • Disable caching for pages with passwords or licencing information.
  • Wait.  And wait some more.  Until the cache clears itself.

There are a host of workarounds to make out of date websites less likely.

But at the end of the day it's a common occurrence and it's part of the price we pay for higher WordPress website speeds.

Conclusion

Hopefully this served as a little introduction to WordPress caching. You now understand a bit more about caching than most folk. In an upcoming article I'll expand on this by going into the types of caching and how to use them effectively to increase your WordPress website speed.

In the meantime, for all the websites I visit that have already been cached… my gratitude goes to visitor number 1 for your speed sacrifice.

thank you for caching

Photo by kevin Xue on Unsplash

Thanks for reading and if you found this useful please hit one of the share buttons.  It would mean a lot to me and it helps others find the article.

How to measure WordPress speed

HOw to measure the speed of your wordpress website

Photo by Tristan Gassert on Unsplash

Measuring your WordPress website's speed is the first step in improving performance.  Here's where to do it and how.

Why wait?

I don’t like waiting in queues. I don't think anyone does.

Google may not know everything but they do know that.

That's why making sure your WordPress website is as fast as possible should be one of your top priorities as a WordPress website owner.

The first step to getting a faster website? Measure!

These tools help you measure your site’s speed so you can make changes and track improvements over time.

In future articles I'll cover many way you can dramatically speed up your site. But not in this one.

In this article we’re dealing only with that first step of measurement.

Why test my WordPress website speed?

Because it’s important. 

It’s important to Google; it’s important to your website visitors; it’s important to your business.

Important things to note

  • Each of these tests will give a different result. 
  • The results given by these tools will vary over time, often by quite a lot. This is caused by the changing load on your website server, the load on your local internet connection and other factors. This variance is completely normal.
  • A user visiting your website for the first time may not have the same experience as one who has already visited, depending on your caching settings and theirs.
  • It’s also important to note that your website speed varies around the world. Is your website hosted on simple shared hosting in the US? Then a user in Australia may have a very different experience with your website than one in the US.

What to do with the speed test results

It’s important to realise that our measurement should shed some light on where we need to improve things on our site.

It's also important not to get fixated on the actual score in these tests. Scores don’t matter as much as making gradual speed improvements to your WordPress site over time.

Use the results to guide you toward making those improvements. Don't waste effort trying to get top marks on all tests.

Do this and you won't freak out about the occasional 8 second load time. (Nor will you get ecstatic about that random 468 millisecond lightning performance.)

​The most popular website page speed testing tools

These are some of the most popular free online tools for measuring WordPress website speed. As you go through them, note the wildly different results for the same site.

Gtmetrix

GTMetrix gives a great all-round view of your WordPress website performance. It actually uses two other tools: Google Page Speed Insights and Yahoo’s YSlow.

It’s easy enough for beginners to get started quickly. It's also comprehensive enough for more seasoned professionals.

gtmetrix wordpress website page speed test wpstrands result

Not the best day for this site

Like most tools here, it provides a waterfall chart of your site's performance. It takes some work to understand the chart and this may be a bit technical for most. But GTMetrix does a good job of providing help via links in the test results.

Particularly useful for beginners is the list of images that need optimising. Optimising your site's images can give one of the best performance boosts for the least amount of work.

Tests are free to run but if you create a free account you have more options; you can save tests and pre-configure test settings.

Learn to make the most of GTMetrix with this article from Kinsta.

Pingdom

The Pingdom speed test is probably the most popular tool of all for testing WordPress website speed. You can run tests from different parts of the globe and again get a waterfall view of the results. Pingdom changed their results page in 2018 and it isn't as useful for beginners as it once was, but it still give some useful measurements.

pingdom wordpress website page speed test wpstrands result

Taken at the same time as the BTMetrix test above - Pingdom likes me better than GTMetrix does today

Here's one useful feature of Pingdom's results that I really like: I can see exactly what is taking up space on my page. In the example below it's clear that images and Google fonts make up 75% of this website page and maybe the owner should look into using fewer fonts as well as optimising images as much as possible. (This problem is getting more common, by the way, so make sure you don't load too many of those free fonts.)

D:UserssocDownloadspingdom wordpress website page speed test content size.jpg

All previous tests for your site are stored so you can easily track improvements over time.

Read how to use Pingdom in this article from Kinsta.

Google page speed insights

Of course Google has their own speed testing tool

The best thing about this test is that they give you a very useful guide to HOW to improve your score. It pays to follow this advice; it is Google, after all.

google insights wordpress website page speed test result

Read how to use it here.

Google also has a separate test for mobile devices, the Google Mobile Website Speed Testing Tool.

Want a super-fast WordPress site?

This article covers just one step of our own speed checklist. Download it now.
It'll show you how I get load times of 3 seconds or less. Even on cheap shared hosting!

Some other website speed testing tools

Load Impact

Load impact adds a new dimension to the average website speed test: it mimics the behaviour of many users visiting your site at once. 

This small load test (25 users in the free version) can reveal some interesting points about the performance of your hosting plan.

It’s also very interesting to watch the test progress on the chart as the test adds new users.

wordpress website page speed test loadimpact

WebPageTest.org

Patrick Meenan is an engineer at Google who’s been working on web site performance for over 16 years. This open source tool he wrote, simply called WebPageTest.org, has some nice little features, e.g. selecting a location from a global map or testing on a variety of browsers. 

It also gives some different data that the others above don’t give.

wordpress website page speed test webpagetest

DareBoost

Do you need a report on website page speed for management or for a presentation? Then DareBoost is the tool you need. You get 5 free reports per month and the best thing here is the very professional design.

As a bonus they highlight some potential security issues on your website.

wordpress website page speed test dareboost

New Relic

The best thing about New Relic's web page test is that it shows plugin speeds and external services that are slowing things down.

wordpress website page speed test newrelic

You do need to sign up to use it, though; always a bit of a deterrent for me.

Dotcom-Monitor Website Speed Test

With Dotcom-Monitor's website speed test you can view your fastest-loading elements to boost your ego. And your slowest-loading elements so you know what to work on.

wordpress website page speed test dotcomtools

Uptrends Website Speed Test

The Uptrends website speed test is nice and simple to use; just select a city and a browser on desktop or mobile.

I had problems when testing it though, as it just froze whenever scanning my site ...

wordpress website page speed test uptrends

website speed testing plugins for WordPress

There are a few WordPress plugins to help pinpoint speed bottlenecks. They can’t do the same job as the sites above. But they do offer the convenience of being reachable from your WordPress dashboard.

This group of plugins are generally for more advanced users. As such they don't tend to gain a lot of traction in the WordPress community. While researching for this article I came across a bunch of plugins that haven’t been updated in years. As is best practice when choosing any WordPress plugin, just stay away from the outdated ones.

Plugins come and go and evolve rapidly.  It's best to install the plugin you want to use, run your tests and make your reports, then remove the plugin.  When you come back to test speed again, you can check for the best plugin at that time.

NOTE:

You’ll see recommendations all over the Web for the GoDaddy plugin, P3 (Plugin Performance Profiler).

It was the go-to plugin of its kind for a while but it hasn’t been updated in 3 yearsStay away from the plugin and stay away from anyone who recommends using it!

Below are some safer alternatives.

Performance Tester

This plugin comes from the makers of Dareboost, mentioned above.  Simple to use, easy to understand and with a link to a full, beautiful DareBoost report. 

WordPress Inspector

WordPress inspector does speed, SEO and security checks. A useful feature is checking for broken themes and plugins!

WP Hosting Performance Check

This plugin gives you an interesting - if you're into that sort of thing - look behind the scenes of your website and into the server performance. From what I can see it does a nice job of it; nice graphs and some useful info about your server you wouldn't otherwise know.

Unfortunately, I found it quite buggy on a few test sites.

Query Monitor

Query Monitor helps debugging by showing your website's database queries. It's very useful if you’re technical enough to understand what the queries are trying to do but otherwise it's probably too advanced.

​Debug Objects

Another advanced one, this can shows database queries, memory usage and function calls. Again, it's quite advanced.

Google PageSpeed Insights for WordPress

This plugin has been around for years and is as reliable as ever. It produces nice shiny graphs etc. that are good enough to impress even a management team. It clearly shows the top areas for improvement on your WordPress site.

You need to have a Google API key, which is easier said than done because Google keep moving it around. Also, the plugin hasn't been updated in 6 months; not really serious yet but worth keeping an eye on. If it's not updated by the upcoming major release of WordPress (November 2018) I would forget it (and I'll remove it from this list.)

UsageDD

Again aimed at Administrators rather than end users, this plugin does just what it says, showing the most important metrics to help check where you might have site problems.  Actively updated and the author also gives a nice summary of the metrics on the plugin page.

Browser tools to measure website page performance

I won't go into these beyond listing a few you can take a look at.  They're for the more advanced user and, if you just want to quickly see where you can make some major site improvements quickly, not very useful.

Chrome Developer Tools (built-in)

YSlow (browser plugin)

My recommendation

At WPStrands we scan every customer website daily with Google Page Speed Insights and YSlow.  The result of those scans is the starting point for our attack on a sluggish site. From there we'll also regularly use pingdom to get a different point of view and if the case demands it we'll use some of the more advanced tools mentioned above.

Conclusion & next steps

So, you've run your tests and know that your site isn't as fast as you'd like!  Now what?

Stay tuned. In upcoming articles I'll be going into detail on exactly how to make regular improvements to your WordPress website that will guarantee a site that's fast enough for both Google and your visitors.

In the meantime, take a look at the first post in the series, how to optimise images for wordpress. It shows you the technique that will give you the highest speed increase for the least investment in time,effort and money.

Sources

https://kinsta.com/blog/website-speed-test/
https://premium.wpmudev.org/blog/free-speed-testing-tools/
https://themetrust.com/test-wordpress-site-performance/
https://www.wpexplorer.com/testing-wordpress-performance-speed/
https://www.smashingmagazine.com/2014/06/how-to-speed-up-your-wordpress-website/
https://royal.pingdom.com/2018/03/07/web-performance-top-100-e-commerce-sites-in-2018/
https://asphaltthemes.com/alternative-to-p3-plugin-performance-profiler/
https://asphaltthemes.com/alternative-to-p3-plugin-performance-profiler/
https://www.wpexplorer.com/testing-wordpress-performance-speed/

P.S. It's not your fault if your WordPress website is a bit slower than it could be. After all, you aren't a WordPress specialist. But we are ...

And you can have the very checklist we use on each and every one of our clients' websites. Download it here.


Want more WordPress speed help?


BE AMONG THE FASTEST WEBSITES IN YOUR INDUSTRY!

Download our very own speed checklist and join our mailing list