Speeding Up WordPress


speedometerSpeeding up WordPress is often a top priority after pushing a site live. Sometimes you add some plugins and it slows down. Other times it’s slow from the start.

This post will go over some of the main causes for a slow WordPress site and walkthrough some solutions that can help to speed up any WordPress website.

Diagnosing the Problem

There are a few tools that you can use to get an idea of where the problem(s) might lie.

First, run a test on a few of your website’s slowest pages on WebPagetest.org. WebPagetest is a tool developed by Google that will give you a high-level view of the performance of your site – from there, you can see which areas of your site need the most work.

The main metrics to look out for are as follows:

Time to First Byte – This is how long it takes for the server to start sending over content to be rendered by the browser. In the context of WordPress, this is often where you’ll see the biggest impact from running a lot of plugins.

Keep Alive Enabled – Any reputable web host should have this enabled. This allows multiple requests to be served via the same socket. If you don’t have this enabled, contact your web host or click here to read how to enable it.

Compress Transfer – Servers with gzip enabled are able to send over certain resources like CSS, javascript, and images in the gzip format, which results in faster website load times. If your host is running on cPanel, you can enable this under the “Optimize Website” option in cPanel.

Compress Images – Exactly what it sounds like, this grade indicates whether the images found on the submitted page were properly optimized for the web. Generally this means saving JPEGs with a quality of 70% or less in Photoshop – a very slight but noticeable decrease in image quality. This can make a huge difference if your theme is utilizing a lot of images.

Cache Static Content – It seems like everyone knows to enable a caching plugin like WP Super Cache or W3 Total Cache, but are you also caching your assets client-side?

Thankfully, this is an easy tweak, and just requires editing your .htaccess file in most cases. Placing the following rules above the “# Begin WordPress” comment should be enough to get you started:

## EXPIRES CACHING ##

ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 7 days"

## EXPIRES CACHING ##

Effective Use of CDN – If your website or blog has a large audience, you’ll want to look into using a CDN like Amazon Cloudfront to host your images and static files. This allows you to use the power and distribution of enterprise-grade servers to host your images, offering a clear performance benefit for users that are far away from your website’s actual server.

Speeding up WordPress even further

Once you’ve ran and understand the results of WebPagetest, you’ll likely need to do some tweaking to get WordPress running optimally on your setup. If you noticed a large Time to First Byte, try installing the P3 Plugin Performance Profiler by GoDaddy. This will let you run a scan of your site and should give you a decent idea of what plugins may be causing your WordPress site to run slowly.

If you’re using Google Chrome, I also highly recommend the PageSpeed Insights Chrome Extension. This adds a tab to your Chrome Developer Tools with more detailed suggestions from PageSpeed Insights:

Screen Shot 2015-02-25 at 10.00.23 PM
The PageSpeed Insights tab added to the Chrome Dev Tools.

This tool offers more specific details on the resources being loaded and can give you an idea of how much of an impact each stylesheet or javascript file is having on your website, and how much can be saved from compression and minification.

Research Further

Running a fast website means that you’ll need to stay updated with the latest standards and software. The best solution now may not be the best solution a few years down the road. A safe bet is to bookmark the official WordPress guide to optimization, which is updated regularly with best practices on speeding up WordPress.

Did we miss something, or do you have any tips or tricks for speeding up WordPress that you’d like to share? Let us know in the comments below!

Leave a Reply

Your email address will not be published. Required fields are marked *

*