How to Improve the Speed of Your WordPress Site – the Ultimate Guide

With internet connections getting faster and faster every year, you would expect that optimizing the speed of your website would become less of a priority. That is not the case.

If your website does not load within a few seconds, most people will simply lose interest. In 2009 almost 50% of people polled for a survey expected a website to load in 2 seconds or less. For an eCommerce website, that can mean lost sales, return customers, and overall revenue. For a blog, that could mean losing a loyal reader who might have shared your content, or subscribed to your list.

Search engines have been heavily pushing for more lightweight websites over the last few years. Google has gone so far as to rank fast loading websites higher than slow loading sites. This has helped put website optimization firmly back in the limelight.

If you want to go from this:

To this:

Keep on reading, and I’ll show you exactly how you can get similar results.

This how-to-guide will show you how to improve your WordPress Site’s speed from long, customer-scaring load times of over 3-4 seconds, to 2, 1 or even load times of under a second. (This is what I experienced when I used just some of the steps outlined here on one of my websites.)

WordPress Site Speed Guide for 2015

Before you apply any of the suggestions detailed in this article, you should test the speed of your website using a site speed testing service such as GTMetrix, Pingdom Tools. or Google PageSpeed. Take a note of your page size, http requests and load time(or take a screenshot) and then run a test again after you have modified your website. This will give you a clear understanding of how your website speed has improved.

I like to test with both GTMetrix and Pindom Tools, just in case one of them futzes up the results. You’ve already seen my before benchmark from Pingdom, and my GTMetrix benchmark looked like this:

1. Choose Your Host Wisely and Get Your site to Load under 1.5 seconds

For many this would be the last resort options for improving site loading speed, as it probably should be given how huge of a difference on-page optimization can make. But the fact of the matter is, not all hosts are created equal, and hosting packages are definitely not.

Most WordPress sites start out on quite humble hosting packages on budget webhosts. Which is not necessarily bad at the time, when you’re not really getting many visitors or using the website to bring in business. But a lot of these budget packages basically boil down to maybe a small percentage of an outdated server, which can put a dampener on your site speed no matter how much you optimize the actual site.

Even if you use a CDN effectively, if your website takes over a second to get to the point where it’s even calling on the CDN for the media and other elements, it’s always gonna be slower than it has to be. If you’ve improved all elements mentioned here except for the host and your loading time is still longer than 2 seconds, the core problem might be your host. If your website is business oriented, and brings in a fair amount of customers, you might want to change hosts or plans at this point.

The ‘wait’ for your website is how long it takes to contact the server the first time, before it even tells the browser anything. And this wait can depend greatly depending on how overworked your servers are. For example, if you’re on shared hosting, you could be unlucky, and share your server with people who use a lot of the memory. This can turn into extraordinary load times during peak hours. (In the past, I’ve seen variations from three, all the way up to nine seconds depending on the time of day.)

If your own website is heavily trafficked, and none of the other steps in this guide seem to improve your site speed to under 2-3 seconds, you might need to change hosts.

If not, and your shared hosting seems quite stable, this is probably not going to be your biggest win, unless you’ve already optimized your site as much as you can without actually upgrading.

But it is definitely worth looking into. After all, most worthwhile CDNs cost money, and a better host could be enough if you mostly have a region specific audience. For lightning fast hosting, as well as hands-on help to migrate and optimize your site, we recommend WP Engine (our review).

Pro Tip

Go with WPEngine, as they have been in the market for a long time and provide great customer support. and never had any problem. Their infrastructure include staging area, HHVM support, CDN integration, improved security, daily backups, and EverCache caching technology for massive scalability and speed.

2. Choose Your Theme Wisely

Another thing that is a little more labor-intensive and stressful, but at times necessary to increase the speed of your website, is to change your theme. Now for this to be worth doing, you will have to be using a very clunky, overweight theme that drags in a lot of outside elements, creating an overload of http requests. The real problem is that many themes fall into this category.

If your theme animates stuff unnecessarily, or forces you to show giant sliders at the top of every page, or if the list of it’s functions and suitable websites is longer than two A4 pages, this is often a safe indicator that your theme is a little on the clunky side.

If you’re considering changing themes, I would recommend that you test your theme demo site, on Pingdom Tools or GTmetrix, and compare the feedback towards possible substitutions that are simpler and prioritize speed. Because of the possible differences in server loading speed for the demos, don’t look at the loading times, but focus on the number of requests and maybe also the page size.

Now keep in mind that Airship and One Touch show many more elements on their demo pages than Genesis, but if you look at the individual requests, you will see several outside scripts and stylesheets. Sure this can be optimized through a caching plugin, but you can’t completely delete the effect it will have on your loading speeds. I’m sure if you opted to use less of One Touche’s functionality it would show a lot fewer requests, but the option to put sliders and other aesthetically pleasing little things on the homepage might be tempting for many.

This is easy to test, but it’s always hard to get another theme to look right without hands-on experience. So when you find a lighter theme that you like, you should set up a local/other development installation of your site, and then you can prepare all the necessary tweaks to make it instantly look good and retain functionality when you eventually change the theme on your live site.

In the past, surprisingly few theme authors went to lengths to eliminate excess code, and keep http requests as low as possible, perhaps they got a little caught up in functionality and design. But these days, with an increasing focus on loading speed, it’s becoming more and more common to optimize for speed.

If your project requires extensive functionality and you get it from a relatively lean theme, or from specific plugins, fear not. You can keep page builders, and other useful functionality and not sacrifice too much on speed, as long as the CSS and JS is tidy, and you have properly configured caching.

Pro Tip

Never ever use multi-purpose themes, of course, there are some exceptions, but generally multi-purpose themes tend to be bloated. Go with themes that are designed to solve a specific purpose. Here at WPKube, we are using Genesis Framework, which comes with some great features and minimal design.

Delivering a static home page can be a great idea, not only for site speed purposes, but for conversions as well. For example, if you have an about page, or a start-here page, or a landing page, you can modify it a little and easily set it as your home page through the theme customizer.

But if you don’t want to go through the hassle, or you simply don’t know what to put on one, a must do is to set your maximum number of posts shown on the home page to 4-6.

You should also either show excerpts, or manually insert ‘more tags’ in your posts, especially if you have multiple images in many of your posts. This can drastically reduce load times in itself, but if you have a lot of traffic it will also reduce the load on your server, which will most likely make your load times even faster.

The whole point here is to make first-time visitors able to load your homepage as quickly as possible, while still giving the same amount of reading opportunities at the click of a button.

4. Remove Unnecessary Plugins

Plugins are the reason why the WordPress platform is so flexible. Unfortunately, plugins are also one of the main reasons WordPress websites are slow. Every plugin you activate adds weight to your website. Even basic plugins with little functionality can slow down your website considerably if they are poorly coded. This has led many WordPress hosting companies to disallow problematic plugins from being used by customers.

There are a number of ways in which a plugin can slow down your website:

Increasing the Size of Your Database – The additional data that plugins store take up a lot of space in your database. Certain types of plugins, such as statistical plugins, are known for adding hundreds or even thousands of new rows to your website database. As a result, your pages take longer to load.

Persistent Requests to Your Database & Server – Constant requests to your database can put a lot of strain on your server’s CPU. This can increase the risk CPU throttling and have a detrimental effect on performance.

Calls to External Services – It is difficult to optimize a web page that makes excessive calls to external services. Social media sharing buttons, for example, can slow down your web page by half a second or more.

It is therefore imperative that you deactivate and delete any WordPress plugins that are not vital to your website’s success. Do not fall into the habit of leaving plugins activated because you might use them again in the future. If a plugin is important, keep it activated. If it is not, uninstall the plugin. You can always reinstall the plugin at a later date.

If you want a better idea of which plugins are increasing your page loading times, I recommend using the P3 (Plugin Performance Profiler) by GoDaddy. The plugin will review every plugin you have activated and detail how much time it adds to your page loading time.

Some people feel that the performance profiler is not accurate enough, and prefer simply enabling/disabling one plugin at a time, and testing the resulting differences in speed using the tools mentioned above.

5. Reduce the Weight of Your Images

Modern website designs are generally quicker than the table based designs that were used years ago. Designers now use CSS to style their designs instead of tables and images.

While website designs have got lighter, the number of images that are being used within the content area has significantly increased. It is not uncommon for articles nowadays to include dozens of photographs. As each image increases the file size of the web page, your page loading time also increases.

There are a number of ways that you can reduce the weight that images add:

Decrease the file size of your images by optimizing your images before uploading. Most graphic editing programs have the option to do this built-in, however there are many stand-alone image optimization applications available such as ImageOptim and RIOT.

Another important point, is to only upload images that fit (or at least are close) the actual dimensions you use on your website. The appropriate size depends on how wide the content section of your blog is, which depends on whether or not you use a full-width theme, so you’ll have to find out for yourself what the appropriate with is.

If you don’t know where to find this width in the CSS code itself, you can simply measure it out in with this online tool.

6. Utilize Lazy Load

Lazy load basically stops a browser from loading images, or other bandwidth heavy elements such as iFrames, until the browser actually scrolls down to where they are. This means even if you have 10 pictures on your homepage, as long as only 2 are visible to the user when he is first loading your page, they are the only pictures that will be loaded, significantly decreasing page size and load times.

I personally use and recommend the BJ Lazy Load plugin. Setting it up is as easy as it gets. Install, and activate.

7. Optimize Your Database

The default configuration of WordPress is not efficient. It keeps a lot of unnecessary information that needlessly inflates the size of your database by retaining spam comments, trash items and excessive post revisions.

Post revisions are one of the main reasons WordPress databases grow too big. In addition to storing an autosave, WordPress will keep a copy of every draft you have ever saved for your posts and pages. It is one of my favorite features as it protects you against lost internet connections and allows you to refer to older drafts.

Unfortunately, beyond a few drafts, post revisions can be wasteful as WordPress does not limit the number of revisions that are saved. Therefore, if you saved your article fifty times, there would be fifty drafts saved in your website database. This takes up the same amount of storage in your database as fifty published posts with no revisions.

Thankfully, WordPress allows you to limit the number of post revisions that are saved. All you need to do is add a line of code to your wp-config.php file.

I personally feel that three revisions is sufficient; however many website owners reduce this to just one. You can also disable post revisions completely by changing the value in the above code to “0” or “false”. If you are not comfortable editing your wp-config.php file, I recommend using a plugin such as Simple Revision Control instead.

Another thing you may want to consider is reducing the length of time items are kept in trash. Whenever you delete an entry through your WordPress admin area, whether a post, page, or comment; WordPress will move the item to trash. This is a failsafe system that allows you to restore any items that were accidentally deleted.

By default, WordPress will automatically delete items that have been in trash after thirty days. This can be reduced by adding the following line to your wp-config.php file:

Server response times can be vastly improved by keeping the size of your database small, so I encourage you to take action and optimize your database.

8. Enable Website Caching

Caching plugins allow you to generate static HTML files of your pages and display them to visitors. Utilizing caching can have a major improvement on your page loading times as the number of requests to your server drops considerably.

There are many great caching plugins available for WordPress. By far the most popular are W3 Total Cache and WP Super Cache. For this guide, you should go with W3 Total Cache, as it makes implementing a CDN(content delivery network) a lot easier later on.

In addition to generating static HTML files, caching plugins also improve your website speed in a number of ways. They support optimization methods such as Gzipping, browser caching, minification, compression of CSS and Javascript, and much more. Many caching plugins also integrate well with content delivery networks.

Pro Tip

Most managed hosting providers such as WPEngine or Flywheel, come with their own caching solution, so if you are hosting your site on Managed hosting environment, you won’t have to install caching plugin.

9. Use a Content Delivery Network (CDN)

Every time you visit a website, your computer has to download files from the server that the website is hosted on. The time that it takes for this information to be received is known as the response time; and it can be one of the biggest reasons a website loads slowly.

Response times can be as much as half a second. When you add in the total file size of a web page, the overall time a page takes to load can add up to be several seconds.

The further you get away from where your website is hosted, the higher your response time will be. For example, if your data center is located in New York, a visitor from Texas will get a better response time than someone who is situated in Moscow. The best way to resolve this situation is to take advantage of a Content Delivery Network.

Content Delivery Networks take a copy of your files and store it in one of their many data centers around the world. Instead of downloading a copy of your files directly from your server, visitors will automatically download a copy from a data center that is near to them. This ensures that all visitors will get fast loading times while viewing your website.

There are several major players in the CDN market. I personally recommend MaxCDN. MaxCDN is used by huge websites such as Nissan and StumbleUpon. They also have peering partners in a total of ninety countries.

If you start using MaxCDN, they will host files that take a long time to download. This includes images, CSS files and Javascript files. These larger files will then be delivered to visitors through a data center that is closer. As a result of this, page loading times are dramatically reduced. This is in partly due to their average response time being only 39 milliseconds.

Content Delivery Network’s are not free, however please bear in mind that your hosting costs will be reduced significantly by a Content Delivery Network as they handle the majority of your bandwidth. What’s good about MaxCDN is that they have great pricing and reliable service.

Hotlinking is when somebody uses your image on their website. Basically, their making your server do the brunt of the work on their pages.

Brute-force attacks is basically when someone has set up a script or program to repeatedly try to login to your admin area. Just trying infinite variations on password with a few different usernames the attacker thinks might be yours.

To protect yourself from brute-force attacks use the login lockdown feature. This makes it so that when someone from a particular IP adress fails to login successfully too many times, they get blocked from accessing the login page.

You should also move the url of your login-page so that only you will know where to find it. This will serve up a 404 error page, stopping scripts from pinging your database and server non-stop.

If you never access your WordPress site except from home and from work, you can use the whitelist function to whitelist only your work and home IPs. This will mean that only people with the same IP as your workplace or home will be able to see the login page and login to the admin area. If you don’t know your IP, you can simply ask Google what your IP is. (Beginners should be careful with this option, because they might find themselves locked out of their own admin area, unable to reverse what has been done without outside help.)

Something that will protect you from both brute-force attacks and spammers, is enabling the ‘5G Blacklist firewall rules’. Another thing that will help to stop spambots is forbidding comment posting.

And lastly, disable hotlinking to keep people from serving your pictures from your server on their website.

You can also use CloudFlare to help combat the brute-force attacks and spam-bots.

Test and Share Your Results

I hope you have enjoyed this look into how you can improve the speed of your WordPress website. I have touched upon what I consider to be the biggest factors that impact page loading times. Don’t forget to test your speed again using Pingdom Tools or GTMetrix.

My final results according to GTMetrix:

Did you try any of the steps outlined here? What were your results in loading speed improvement? What steps do you take to optimize your WordPress websites? Please feel free to drop us a line in the comment area :).

Note: This post was originally written by Kevin Muldoon and later modified by Ragnar Miljeteig.

Nice article, though I see a few things that are missing such as selective plugins/assets loading. This can dramatically increase performance in some pages but to my surprise it’s often overlooked by many people. There are 2 free plugins that if used wisely can make the page load much faster:

1) To select plugins that will not load on specific page (e.g. Contact Form 7 loads its CSS and JS in all pages when you might need it only on the Contact page) you can use “Plugin Organizer” plugin.

2) Sometimes, you need to have a plugin enabled on a page but it’s loading 10 assets and you will only need 5 of them on that particular page. To filter the .CSS and .JS that is not needed you can use “WP Asset Clean Up”

Thats a pretty comprehensive list right there 🙂 Very impressive and a lot of good information. I use all the points you raised except I have not yet delved into the world of CDN. I want to have a go at setting it up sometime soon though as it makes a lot of sense. Thanks for the article Kevin. Good work

I was only asked to write a limited number of words, so I had to pick and choose what was left in and what was left out. As such, this post should be considered an overview of the subject rather than a comprehensive guide.

Though I do think that there is not too much to Gzipping. It is one of the best things to do, but apart from enabling gzip through WordPress and ensuring your host supports it, there is nothing else to do. It just takes care of itself. 🙂

Although a condensed post (targeted to the end-user, so there was no code perspective), it’s an excellent one!

I recently completed a project for a client turning his grades from E to A (minimizing loading time to under a second) with many of the practices you suggested in my “tool-set”. (Although he didn’t wish to change his theme and host -sigh!)
I was just about to write a case study when the “WhiP” informed of your post.

Thanks for great articles but I think there is lack of information how to speed up WordPress website without removing plugins because I’m pretty sure most of people have minimal amount of plugins already installed.
Here’s premium plugin which controls conditional unloading of CSS and JS:
Gonzales WordPress plugin

Hi Kevin, great tips. Especially liked the one about removing unneeded plugins, this actually made the biggest difference in speed for me. Next to Pingdom and GTMetrix, do you know of any good online tools to test website speed with? I found http://www.webpagetest.org and http://www.giftofspeed.com and they are decent but I’m looking for more in-depth analysis. Also, is there benchmarking software for websites available? Anyone reading this can answer too if they know. Thanks! Megan

Glad you found Kevin’s article useful. Removing unnecessary plugins can have real impact on your site speed. Another thing you can do is to disable unnecessary scripts that aren’t needed on homepage. It can be done wit the help of Gonzales plugin — http://tomasz-dobrzynski.com/wordpress-gonzales

Regarding the tools for performance deep analysis, I think GTMetrix is the best free option out there. You could also try LoadStrom and WP Performance Tester.

Participate in this conversation via emailGet only replies to your comment, the best of the rest, as well as a daily recap of all comments on this post. No more than a few emails daily, which you can reply to/unsubscribe from directly from your inbox.

Full Disclosure This post may contain affiliate links, meaning that if you click on one of the links and purchase an item, we may receive a commission (at no additional cost to you). All opinions are our own and we do not accept payments for positive reviews.

Exclusive deals

SiteGround: 60% OFF

About WPKube

WPKube is an online WordPress resource which focuses on WordPress tutorials, How-to’s, guides, plugins, news, and more. We aim to provide the most comprehensive beginner’s guides to anything about WordPress — from installing plugins, themes, automated installs and setups, to creating and setting up pages for your website.

We have over 500+ tutorials, guides, product reviews, tips, and tricks about WordPress. Founded by Devesh Sharma, the main goal of this site is to provide useful information on anything and everything WordPress.