Speed Up Your WordPress Site

Chris Burgess

This article was sponsored by GoDaddy. Thank you for supporting the companies who make SitePoint possible!

As one of the top user experience factors, website performance is more important than ever. Website speed and performance on mobile devices is particularly important, with a rapidly growing number of visitors accessing the web via smartphones and tablets.

While WordPress is very easy to get up and running, making your site speedy requires a bit more work, and is an ongoing process. In this article we’ll cover why speed matters, and offer some practical advice for how to speed up WordPress.

Improving performance takes a lot of trial and error, but it’s great fun!

Why Website Speed Matters

First impressions count. The benefits of a faster website are numerous, but the three main advantages are:

1) Better User Experience

It’s well documented: people love fast websites and despise the slow. So, if you care about your users, you should care about the speed of your website. Slow website loading times are one of the largest contributing factors to website abandonment. According to KISSmetrics, 47% of consumers expect a website page to load within two seconds. If it doesn’t, they’re not likely to hang around.

2) Improved Search Engine Rankings

Google hinted at the importance of site speed to search ranking many years ago, and in 2010, announced that site speed was a ranking factor. Fast-forward four years and Google’s obsession with speed has increased. Google now heads an initiative called Make the Web Faster, offering a wide range of tools and resources designed to help developers and webmasters build faster websites.

Yahoo! has also been a long time advocate of a faster web, and maintain extensive resources for web performance optimization at the Yahoo! Developer Network.

3) Higher Conversion Rates

There has been a considerable amount of research conducted into the impact of site speed on companies’ bottom line. The most well known statistic is from Amazon, who reported an increase of 1% revenue for every 100 millisecond improvement in page speed.

Similarly, Mozilla published data revealing that Firefox downloads increased by 15.4%, as a direct result of reducing the average page load time by 2.2 seconds.

Running Your Own Website Speed Test

Before making any changes to your site, it is a good idea to run a page speed test, to establish a baseline. There is plenty of speed testing tools available, ranging from web services to browser extensions. The most popular tools include:

All of these tools have similar features and give you both measurements and scores, as well as a list of suggested areas for improvement. PageSpeed Insights also gives you mobile statistics.

Google PageSpeed Insights

Reviewing WordPress Performance Issues

Aside from standard page speed tests, you may want to take a closer look at WordPress itself. Once you’ve acquired solid baseline data on the performance of your site and identified any issues, you can try isolating the problem. This can be achieved by disabling or enabling plugins, activating a different theme or commenting out custom code. Alternatively, use the following tools to analyze WordPress specific performance.

P3 is an incredibly handy WordPress plugin that provides a detailed breakdown of your plugins’ impact on load time. It’s a very easy way to diagnose potential problems and identify resource hogs.

P3 Plugin Chart

NewRelic also provides in-depth analysis of web application performance. If you’re running your own server, and need greater visibility when it comes to your application, investigate NewRelic.

WordPress Performance Factors

A long list of factors can impact on the speed of your site, including DNS, hosting, server resources and configuration, as well as theme, plugins and even content.

Your Hosting Provider or Server Configuration

When it comes to hosting, cheaper is not always better. If you’re serious about the performance of your website, make sure you choose the right hosting provider. If you prefer a more hands-on approach, there are plenty of guides to building your own optimized server. Otherwise, there are many hosting services available.

Keep in mind that it’s not uncommon for WordPress to hit memory limits if you’re using resource-hungry plugins, especially on shared hosting. Server-level optimization is well worth exploring if you’re managing your own servers.

Specialized WordPress Hosting

Managed WordPress hosting has come a long way in the past few years. Some of the biggest players, like GoDaddy, offer WordPress optimized hosting that includes daily backups, automatic core updates, comment spam filtering, built in caching, DDoS protection, and malware scanning.

For a long time, a popular myth has prevailed: shared hosting just isn’t worth looking at. But, in reality, it really does depend upon the host you choose. Some modern hosting companies purpose-build their hosting platform for optimum performance. As a result, most hosting platforms are fast, and can handle an insane amount of traffic. Just be sure to do your own research and testing before you lock in a shared hosting platform. You might want to start with Tech Void’s recent comparison of WordPress hosting platforms (check out the original benchmark at ReviewSignal.com).

There are also several managed WordPress hosting services, including:

Choice of Theme

Choosing the right theme plays a major role in the speed of your WordPress site. A high quality theme isn’t about how it looks; it’s about how well it has been built and how well it conforms to the WordPress Theme Development Standards. Look for actively developed, well supported themes.

A theme with solid functionality is also paramount, as this will reduce the need for plugins (leading us nicely into our next point).

WPMU Dev have put together a list of the top 10 fastest WordPress themes.

Number of Plugins

At the time of writing, there are 31,539 plugins with 672,957,182 downloads in the WordPress Plugin Directory. This is great if you’re a WordPress developer or user looking for specific website functionality, but there is a temptation to just install one more plugin.

Well-built WordPress sites usually have minimal plugins installed. While it can be tempting to include all the bells and whistles, ask yourself whether it is critical to install that extra plugin. Remember, WordPress out-of-the-box is extremely powerful. It doesn’t require dozens of plugins. So, if in doubt, don’t install it!

Types of Plugins

When you’re selecting a plugin, spend a few extra minutes researching the best option available. The WordPress Plugin Directory displays a few useful pieces of information, designed to make the selection process easier:

  • Star ratings (from 0-5 stars)
  • Notification if the plugin hasn’t been updated in two years
  • Number of downloads
  • Link to support forums
  • User feedback

Outdated Plugin Notice

Install only the highest quality plugins: those that have high ratings, lots of downloads, and that are actively developed and supported.

Keeping Your Site Lean and Clean

Good housekeeping improves overall site performance; always run updates and fix any broken links. It’s also very important to regularly monitor your web server error logs.

Comment (and trackback/pingback) spam is a common black hat SEO tactic. Bots crawl websites that accept comments and then post spammy links for a perceived SEO benefit. Unless you manage this, your site will be constantly hit by bots, exhausting your server resources very quickly. It is not uncommon for websites that have fallen prey to comment spam, to rack up thousands of comments.

The answer: disable comments if you don’t need them, if you do, use the Akismet plugin (comes as a default) or a service to help manage spam.

If your website has already been hit with comment spam, there are several plugins that can help you get back on track, including:

Minifying and Combining Assets

JavaScript, CSS and Web Fonts have given us a better looking and more usable web, but they do increase the weight of a page. As you can see in the chart below from HTTP Archive the average transfer size of all responses from June 2013 – June 2014 has increased, while the number of requests has remained the same.

HTTP Request Sizes

Minification is the process of stripping whitespace from HTML, CSS and JavaScript files. It reduces the size of files that need to be downloaded.

Files can also be combined, reducing the number of requests that your site has to make to the server during loading. The result: quicker loading time. There are many options for minifying and combining assets in WordPress, including:

Image Compression

High quality content will always set your site apart from the rest, but you need to ensure this content is in the appropriate format and is compressed (where possible).

There are a few handy plugins that compress existing, and new, images in your Media Library:

WP Smush.it Plugin

Most compression plugins only apply to files in your Media Library. So make sure anything outside of the Media Library is manually compressed. If you’re using lots of icons, to reduce requests, consider using sprites or an icon font.

Infinite scroll/lazy loading and preloading techniques can also give the illusion of speed, and are worth investigating if you’re running an image heavy site.

Caching

Caching can make a huge difference to website loading time and is easily implemented by installing a caching plugin.

WordPress caching plugins generate static HTML files that are then served to visitors, rather than executing PHP and making database calls. They also enable other optimization options, such as compression and preloading. Caching also helps your site handle a higher volume of traffic. There are quite a few dedicated caching plugins, the most popular are:

It’s also worth mentioning that even security plugins such as WordFence now includes caching capabilities.

You can simulate load and measure performance on your site with tools like:

A simple test using ab to make 100 requests (5 concurrent connections) would look like:

$ ab -n 100 -c 5 http://example.com/

Content Delivery Networks (CDNs)

If your site receives a reasonable amount of traffic, and you are considering taking the next step in website performance, a Content Delivery Network (CDN) might be just the ticket.

CDNs store static assets such as images, CSS and JavaScript files at multiple points around the web, usually at a geographic location closer to your website visitor than your web server. Historically, CDNs were quite pricey, but they are now quite affordable and worth the extra gain if you have a large or global audience, or lots of static assets. Popular CDNs include:

Configuring WordPress to use a CDN is quite easy; your caching plugin will have a section where you enter your account details.

Conclusion

As you can see, there are many factors that can impact on website performance. Performance tuning is a constant process of monitoring and improvement; it is vital that you constantly test and measure.

To recap:

  • Choose quality hosting
  • Choose quality themes and plugins
  • Run a speed test and identify performance issues
  • Minimize the number of plugins
  • Compress, minify and combine
  • Keep your site lean
  • Use caching and CDNs

If you’re looking for more information on web performance in general, take a look at Planet Performance and the official WordPress Codex page on WordPress Optimization.

Free book: Jump Start HTML5 Basics

Grab a free copy of one our latest ebooks! Packed with hints and tips on HTML5's most powerful new features.

  • Stephen Hunt

    How ironic. My GoDaddy-hosted WordPress web site crumpled under less than a 1000 visitors a day and they took my site down for three days (without agreeing this with me), only putting it back online after I harassed their tech support into telling me that CloudFlare would help.

    • http://chrisburgess.com.au/ Chris Burgess

      Hi Stephen, did CloudFlare end up helping?

    • Brett Franklin

      I just switched from Site5 to Godaddy’s Managed WordPress hosting and it’s very fast. Are you on managed or shared hosting? Managed, for one website, was on sale for $12 for your first year.

  • http://petermeadit.com/ Peter Mead

    I might try it out Luc. I have always used WP Supercache.

  • Brett Franklin

    Regarding caching, I think it would be a good idea for you to review, and include, Wordfence’s Falcon caching system. I’ve been using it for a month and it’s remarkably fast and efficient.

    • http://chrisburgess.com.au/ Chris Burgess

      Thanks for the heads up Brett, will definitely take a look at that one!

    • http://chrisburgess.com.au/ Chris Burgess

      Hi Brett, I’ve just added this one. Thanks again for letting us know.

  • http://chrisburgess.com.au/ Chris Burgess

    Thanks for sharing Luc, will check it out.

  • http://chrisburgess.com.au/ Chris Burgess

    Thanks Kevin, I’ve updated the article to also reference your work. Look forward to the updates.

    • http://www.kevinohashi.com Kevin Ohashi

      Much appreciated! :)

  • Oscar Blank

    WordPress is a beast of an application. It has appeal because it’s a powerful CMS, but it’s probably one of the best examples of spaghetti code and code bloat that exists. It is the definition of “code smell”. You can make a website in just a few hours, but you really can’t expect that to be fast. Add on a few plugins, especially ones like WooCommerce, and you can pretty much expect deadly slow performance. Add on Joe Schmo’s super tardastic whiz bang boom plugin, and you might even crash you’re entire website. I can’t even imagine where WordPress will be in another 10 years, with 10 years more spaghetti and code bloat piled on. 10 more years of bad and/or outdated plugins to choose from.

    I do have a love / hate relationship with WordPress though. I can make a website for a customer in as little as an hour, depending on their needs. They think I’m awesome, and I pay the bills.

    • http://chrisburgess.com.au/ Chris Burgess

      I agree Oscar re installing any old plugin, you need to be ruthless and only install good plugins.

      Re plugin performance, are you using some sort of caching?

  • http://wpsites.net/ Brad Dalton

    Based on my experience using 5 different types of servers from 7 different providers, managed hosting offers the best solution by a country mile.

    Level 4 HG VPS cost $80 a month with cPanel and could never get my site loading in under 3.5 seconds.

    Managed hosting cost $30 a month and my home page loads in 1 to 1.5 seconds. Sometimes half a second.

    • http://chrisburgess.com.au/ Chris Burgess

      That’s a good result Brad, nice and fast!

  • http://chrisburgess.com.au/ Chris Burgess

    Thanks Burak, I’ve used Total Cache and MaxCND before and it worked very well. Thanks for sharing the link the tool, it looks very handy.

  • James Bundey

    Hi Chris,

    for image compression I’d recommend checking out kraken.io. It’s a paid service when using a WordPress plugin and API, but the results are really impressive for the cost.

    Alternatively, EWWW image Optimizer is a decent free option that offers goods results.

    • http://chrisburgess.com.au/ Chris Burgess

      Thanks James, I’ve just added these :)

  • James Bundey

    Completely agree with your opinion on wp-rocket. Started using it a month ago with great results. Especially if you’re managing a site that is on average hosting.

  • http://chrisburgess.com.au/ Chris Burgess

    Hi Luc, just following up to let you know I’ve updated this article to include WP Rocket.

  • Kev Scott

    My one worry with CDNs is how do you know they are working correctly. You could be looking at your own site in Europe say and everything looks fine, but if the CDN is having issues your users in Asia and the US might not be seeing any images at all. Do you know of anyway to check the content that your more remote visitors are seeing?

  • http://TeeHunter.com/ Sergiu Poenaru

    Sounds like an article I read on SmashingMagazine a few days ago, except they were affing a different host. I did the whole thing a while ago and it definitely improved the speed.

    • http://chrisburgess.com.au/ Chris Burgess

      It’s definitely a hot topic, performance is an ongoing process so always plenty to do!

  • cool19

    thanks.