Speed Up Your WordPress Site
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.
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.
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
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
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:
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:
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 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.
Configuring WordPress to use a CDN is quite easy; your caching plugin will have a section where you enter your account details.
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.
- 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.
This article is also available in Korean on Web Actually