Speeding up your WordPress Site

Research shows that each second it takes for your site to load costs you lost visitors and conversions. We have collected a few tips to help you improve the loading time for your pages.

Is your WordPress site starting to become slow?

Are you using a lot of plugins, loading many images and different files for javascript, stylesheets and more?

If the answer is yes to at least one of the above, I recommend going through this list on how to speed up your WordPress site. There are actually many ways to speed up your site, if you need all those plugins, images and other things for the website. We recently covered using a Content Delivery Network for resources such as images and javascript files, but even if you don’t have that option you can still often make changes which cut page download in half or even better.

Wordpress

Search engines look at page speed when calculating where your site should be in their search results, and visitors have less patience with slow loading websites each year. Around 10-15 years ago it was often recommended to have your page load within four seconds – which nowadays would like watching grass grow. Some of the tips we gathered here are specific for WordPress, but similar solutions often exist for other blog and CMS platforms. The tips on this page are besides basic things such as getting fast WordPress hosting.

Disable unused plugins

If you have a WordPress with a few years on its neck, you have probably installed quite a few plugins, tried them out, and then forgotten about some. Before you go any further, go through your installed plugins and disable everything you don’t use. Also, have a look at the ones that are in use, and consider if they are actually needed. We recommend temporarily installing P3 Profiler from GoDaddy while doing this, to give you an idea of which plugins are using the most resources. If you notice that a plugin you absolutely need is using a lot of resources, consider switching to a similar one, and don’t forget to read the reviews and check that it works with your current WordPress version.

Only load plugins on pages where they are used

One “feature” in WordPress is that it loads all enabled plugins with every page, whether or not the page actually needs it or not. If you for example have a contact page, a gallery page and a quiz page each needing their own plugin, WordPress will load everything for all three plugins on all three pages, even though they only use one plugin in the actual content for each page.

WordPress Plugins

With some plugins, such as Contact Form 7, you can edit a couple of PHP files to disable the plugin for most pages, and only load the scripts when on a specific page, such as the contact page. However, most plugins don’t have this option, or you might not have the experience to edit PHP files. If you have many plugins which are only used on one or two pages each we recommend adding Plugin Organizer to your WordPress site, which lets you switch off or on any plugin for the pages where you want them.  You simply change the global settings to turn off a plugin by default, and then go to the page where you want to use it and switch on there. Even if you stop reading here, by doing this step you could already save a lot of bandwidth and get much improved page speed.

Minify and combine resources

minifyDevelopers and designers who create JavaScript and CSS files often leave a lot of white space in their files, making them more readable but also taking a considerable amount of space. It’s quite often you can see more than 50% of such a file being empty space, comments for developers, or other things which are not needed for them to work on a page. We recommend installing a minifier to fix this issue, to speed up downloads of HTML, JavaScript and CSS files. There are quite a few plugins for this, and some combine minifying with other great speed improvements, so keep on reading.

Another issue you often see for slow websites is the amount of files to download for each page. You might have 50-100 files on a single page without knowing it, but there’s a solution to this as well. Most of the good minifier plugins will also give you the option to combine the minified scripts. There are cases where you might not want to do this, but most often it will show improvements.

Optimize images

One of the biggest issues is often having many large images, which tend to take up 50-75% of the total download on a website. A major reason for this is usually not having optimized images and removed unnecessary bytes from the image files. One of our favorite WordPress plugins right now is one called WP Smush.it, which goes through all your images and takes away the information you don’t need to show. The extra information could be about the camera and time for a photo, or about the software if a program such as PhotoShop was used to create the image. The plugin has failed on rare occasions in the past, but if you notice something going wrong it’s quite easy restoring the original images with a plugin called ‘Regenerate Thumbnails’.

Speed up wordpressIf you do have pages with many images, we also recommend looking at plugins for “Lazy Loading”, which basically makes the images load only when scrolling down to have them come into view. This way, you can speed up the initial page load without actually changing anything on the page. We recently tested a3 Lazy Load on a page with almost a hundred images, and it went down from taking almost 7 seconds to loading in less than two seconds. There are a few other plugins for this as well, and you should always check if something you install is compatible with your current version of WordPress.

When it comes to images it might also be a good idea to look at if your template is loading the right size in the right place. We recently encountered a theme which was loading all images with original size, then letting the CSS handle resizing even when all images were shown with the dimensions – this included loading images with a width of 1250 pixels shown at 250 pixels, which meant images six times the needed size were loaded, and slowing down the site quite a bit. Adding image sizes requires you to add a single line of code in the functions.php file for your theme. Ask your friendly theme designer or developer if you don’t know how to do this, and tell them you want to add a new default image size (the function is called add_image_size()) .

Cache your pages

Every time you ask WordPress for a page, it goes through quite a few steps before sending something back. In some cases the browser even asks for resources it might already have, such as images, scripts and stylesheet files, which can actually be saved by the browser and reused on multiple pages, which is called browser caching. A common example would be a logo, which tends to be used on all pages of a website, and can therefore be cached by the browser to avoid unnecessary requests to the website.

On the server side, there are quite a few things happening which can be saved, or cached, in a similar way. To avoid most of the extra steps WordPress might take to build a page, you can install a plugin to cache your pages. Popular options include ‘W3 Total Cache’, ‘WP Super Cache’ and ‘Zen Cache’ – which one is best for you depends on circumstances, and all are reliable and kept up to date. WP Super Cache seems to be the most popular one, and includes settings for advanced users, which is also true for the other two, and all have a simple setup with default recommended options.

Test your pages

There are quite a few free online tools to test your pages, and many give great advice on how to improve on what you have. We recommend starting with Google PageSpeed, which gives you valuable insights both for mobile and desktop visits. The tool even creates optimized images and minified JavaScript and CSS files for you to use in your theme, if you’re comfortable with editing those. However, we only recommend editing or replacing JavaScript, CSS and images if having a customized theme or child theme, or changes might be overwritten the next time you update the theme.

Other free testing tools include WebPageTest.org, Pingdom and GTmetrix, which all give you details about what is slow and suggestions on how to fix issues. To get an idea of load times you can also use browser plugins such as Firebug - for an overview just have a look on the Net tab to see how long it takes for different resources to load.

Once you get started improving page speeds you'll notice it's an ongoing project, and you can always find more things to improve.

Good luck, and let us know how you fare in the comments!

Written 2015-07-29 (Updated 2016-10-12)
emil.hunefalk 150x150 140x1401

Written by Emil Hunefalk


Emil has been a blogger and web developer since the late 1990's. He has web, mobile and desktop experience from both large and small projects, in some cases handling everything from user experience to development.

Share your thoughts

Henry Sachs,  3 August, 2015

I have a photography website and the lazy load is a great idea thanks! some of my clients galleries are huge and such a pain to manage! do you have any suggestions on improving upload speed of images to wordpress as well?

Sam B,  3 August, 2015

good to hear about the cache options, have had such an issue with thsi lately and good to hear form someon on the options that work well as my attempts had been pretty poor.

Show all related articles..

Best Value Hosting 2016


Why wait? Get today's best deals now!