How to use a page speed test to optimize your WordPress website

If you’re serious about your WordPress website, you need run a page speed test. There are many variations of these tests out there, and some are more appropriate for your target audience than others. But all of them will give you a pretty good idea of where you can still improve your site.

For some of you, some speed optimization recommendations may come across as “technically challenging”, but lucky for you, you have a WordPress website, which makes optimization much easier. One of the things that makes WordPress so awesome is that there are plugins that can help you. Some are free, some paid-for, but all will help you to simplify difficult tasks. In this article, we’ll tell you about a few places you can test your page speed yourself. Then, we’ll look at some speed optimization recommendations and show you how to solve them using plugins.

Running a page speed test

Running a page speed test is as easy as visiting a website and entering your website’s URL into a box. The speed test then analyzes your website and comes up with recommendations. There are many different speed test tools, but here are a couple worth looking at.

  1. Pingdom has a tool for speed testing, and it lets you test from different locations around the world, or from a server that is relatively close to you. If you’re targeting a local audience, for example, this is a good way to see how fast your website is for them.
  2. Google Lighthouse is a performance tool that lives in the Chrome browser’s Web Developer Tools. To access it, right click on a page, choose Inspect and check the Audits tab in the new window that opens in your browser. Here, you can test speed for mobile device or desktop, and on different bandwidths and connection speeds. The test result looks like this:
    Google Lighthouse test result
    Minor point: most sites appear slower in Lighthouse. This is because Lighthouse emulates a number of situations and devices – for example a slow mobile/3g connection. (see the second bar in the screenshot above). With mobile first a reality, we think this is actually a good thing. If you want to know more, go read Edwin’s in-depth post on Google Lighthouse!

Before Lighthouse came along, Google PageSpeed Insights was a great way to look for speed improvements – and it still is. It even lets you download optimized images, CSS and JS files for your site. But if you’re working with WordPress, you may find it difficult to directly replace your files with these optimized files. Luckily, WordPress has plugins that will generate them for you.

There are many, many more speed testing tools available online. These are just a few that I wanted to tell you about before going into WordPress solutions that will help you improve your site speed.

Optimizing your page speed using WordPress plugins

Once you’ve run a page speed test, you’ll probably feel like you should spend some time optimizing your website for speed. You will have quite a few recommendations, ranging from things you can do yourself and some things that you may need technical help with.

Image optimization

Your speed test might come back with this recommendation:image optimization for speed
Images usually play a large part in speed optimization, especially if you use large header images. Or if your site is image-heavy overall. It’s always a good idea to optimize these images. And it can be done with little quality loss these days. One of the things to look for is, like in the page speed test example above, images that are in fact larger than they are shown on your screen. If you have an image that covers your entire screen, and squeeze that into a 300 x 200 pixels spot on your website, you might be using an image of several MBs. Instead, you could also change the dimensions of your image before uploading. And serve the image in the right dimensions and at a file size in KBs instead. By reducing the file size, you speed up your website.

Setting image dimensions in WordPress

WordPress comes with a handy default feature, where every image you upload is stored in several sizes:Settings > Media

So if you want all the images in your posts to be the same width, pick one of the predefined ones or set your custom dimensions here. Images that you upload scale according to these dimensions and the image in the original dimensions will also be available to use.

This means that if, for example, you load the medium size image instead of the much larger original, this will serve an image in a smaller file size, which will load much faster.

Image optimization plugins

There are also a number of image optimization plugins (both paid-for and free) available for WordPress, such as Kraken.ioSmush or Imagify. Plugins usually remove Exif data from the image, which is a good idea because Exif data includes information about camera settings used to take the photo – really interesting for a photographer, perhaps, but not something you need for the image in your blog post. You can also have these plugins replace your image with an image that is slightly lower in quality.

Some of these plugins can also help you resize your images. Take these plugins for a test drive and see which works best for you and minifies your image files best. To find out more about image optimization, be sure to check this post about image SEO.

Browser cache

Another issue that comes up a lot in page speed tests is browser cache optimization.
Pingdom browser cache recommendationBrowser cache is about storing website files, like JS and CSS, in your local temporary internet files folder, so that they can be retrieved quickly on your next visit. Or, as Mozilla puts it:

The Firefox cache temporarily stores images, scripts, and other parts of websites you visit in order to speed up your browsing experience.

Caching in WP Super Cache

Most speed optimization plugins help you to optimize your site using caching. Sometimes it’s as simple as this:
WP Super Cache
The Advanced tab of WP Super Cache here has a lot of more in-depth configuration for that, but starting out with the set defaults of a plugin is usually a good start. After that, start tweaking these advanced settings and see what they do.

Note that WP Super Cache has an option to disable cache for what they call “known users”. These are logged in users (and commenters), which allows for development (or commenting) without caching. That means for every refresh of the website in the browser window, you will get the latest state of that website instead of a cached version. That last one might be older because of that expiration time. If you set that expiration time to say 3600 seconds, a browser will only check for changes of the cached website after an hour. You see how that can be annoying if you want to see, for instance, design changes right away while developing.

Other WordPress caching plugins

I’m talking about WP Super Cache here because it’s free and easy to use for most people at least. But there are alternatives. WP Fastest Cache is popular as well, with over 600K+ active installs. It has similar features to optimize caching:
WP Fastest Cache
A paid-for plugin I also like is WP Rocket. It’s so easy to configure, you’ll wonder whether you have missed something. But your page speed test will tell you that it works straight out-of-the-box. There are more advanced settings where you can fine tune your site. But before we look at that, we need to talk about compression.

Compression

Your page speed test tool will probably tell you to:

  • Try to minify your CSS files
  • Minify the JS files of your site
  • Minify your HTML files or
  • Enable (GZIP) compression

These recommendations all relate to compression. It’s about making your files as small as possible before sending them to a browser. It’s similar to reducing the file size of your images, but for JavaScript or CSS files, or even a page’s HTML file. GZIP compression is about sending a zipped file to your browser, that your browser can unzip and read. Your speed test’s recommendations may look like this:
Minify recommendation Lightspeed
In WP Rocket, the settings for compression look like this:
WP Rocket - Compression

Again, many of the right settings are on by default, similar to Yoast SEO, but even more can be configured to your needs. Your web server’s settings many also affect how well compression works.

If you use one of these plugins but your compression optimization still isn’t working properly, contact your hosting company and see whether they can help you. A decent host should be able to help you out, especially if it’s one of these WordPress hosting companies.

Serving CSS and JS files

Speed tests will often tell you to combine (external) CSS or JavaScript files or defer parsing scripts. These recommendations are to do with how these files are served to the browser.

The combine option for these files is, as you can see in the WP Rocket screenshot above, not recommended for websites that use the HTTP/2 protocol, which allows multiple script files to be loaded at the same time. But combining these files is still good for non-HTTP/2 sites because it reduces the number of server requests, which again makes your site faster.

Deferring scripts or recommendations like “Eliminate render-blocking JavaScript and CSS in above-the-fold content” are about the way these scripts are loaded in your template files. If all of these are served from the top section of your template, your browser will wait to show (certain elements of) your page until these JavaScript and CSS files are fully loaded. Sometimes it pays to transfer less-relevant scripts to the footer of your template, so your browser will show your website first, and then add the enhancements controlled by JavaScript or CSS files. A plugin that can help you with this is Scripts-to-Footer. Warning: test this carefully. Changing the way that these files load can impact your website. Things may suddenly stop working or look different.

Don’t forget CDNs

A Content Delivery Network caches static content – files like HTML, CSS, JavaScript and image files. These files don’t change that often, so we can serve them from a CDN with many servers around the world, so you can get them to your visitors super fast, wherever they are. It’s like traveling: the shorter the trip, the faster you get to your destination. The same goes for these files. If the server that is serving the static file is located near your visitor (and servers are equally fast, obviously), the site will load faster for that visitor. See this post for more about CDNs.

There are many ways to optimize page speed in WordPress

Page speed tests will give you even more recommendations than we’ve covered here. Again, you might not be able to do all of these yourself. If that’s the case, get help from your web developer or agency, or your hosting company. But in the end, if you want a fast website, WordPress is a great choice because there are many great plugins that can help you optimize the speed of your website after a page speed test!

Read more: Site speed: tools and suggestions »

Use structured data to win in Google!

  • Make your search results stand out
  • Increase traffic to your website
  • On-demand SEO training by Yoast
  • No technical skills required!
More info

20 Responses to How to use a page speed test to optimize your WordPress website

  1. Mukesh kapoor
    Mukesh kapoor  • 4 months ago

    Slow page speed on mobile is now a ranking factor from july. Do you think google is just pushing AMP for its own benefits and pushing webmasters to AMP with this algo change.

  2. West Bay Web
    West Bay Web  • 4 months ago

    I find it amusing that Google complains about there own scripts slowing sites. Oh the irony,

  3. Rajeev
    Rajeev  • 4 months ago

    Thanks for sharing valuable tips for optimizing wordpress press websites. I really informative article.

  4. hangover cure
    hangover cure  • 4 months ago

    Very shortly this website will be famous among all blog users, due to it’s good articles or reviews

    • Willemien Hallebeek
      Willemien Hallebeek  • 4 months ago

      Thanks, that’s so nice of you to say!

  5. Iris Guelen
    Iris Guelen  • 4 months ago

    Indeed Jen, there’s a lot of information available, which can make it quite hard to find the right bits of information. Therefore, we try to offer a complete overview of different kinds of SEO topics, so it’s easier to find the right information. Let us know how it works out for your site, good luck with it!

  6. applicationha
    applicationha  • 4 months ago

    Hello. i now awared from Media attachment url eror. my site very affected from this Problem and lost all the visitors and Rank from google. i do the instruction and change media setting to yes , Updated the addon and instaled the Yoast SEO Search Index Purge. Should I do something else? best Regards my site is : http://applicationha.com/

  7. Daily News Magazine
    Daily News Magazine  • 4 months ago

    Thank You, Yoast! I was searching online for a proper solution and I found it. This article helped me to analyze and fix all the issues I have with my Site.

    • Iris Guelen
      Iris Guelen  • 4 months ago

      Amazing! Glad we could be of help :)

  8. Heeren Tanna
    Heeren Tanna  • 5 months ago

    ive been using gtmetrix along with google page speed tool to find issues and recommendations . also for image compression kraken is the best i came across. havent used their plugin as only paid one has all features i use their web tool to compress before uploading image to my blog.

    • Iris Guelen
      Iris Guelen  • 4 months ago

      That sounds like a great strategy, Heeren!

  9. Shraddha
    Shraddha  • 5 months ago

    Thank you for sharing this information about WordPress. The information of page speed test is easy, and it will be helpful for my further work.

    • Iris Guelen
      Iris Guelen  • 4 months ago

      You’re welcome, Shraddha!

  10. quicken1404
    quicken1404  • 5 months ago

    I don’t think anyone has talked about this topic so clearly so far. This blog is just awesome.

    • Iris Guelen
      Iris Guelen  • 4 months ago

      Thanks a lot for your kind words!

  11. Bri Sullivan
    Bri Sullivan  • 5 months ago

    Thanks for the suggestions! As a photographer with a lot of photos on my site I always have issues with site speed. Thanks again!

    • Iris Guelen
      Iris Guelen  • 4 months ago

      It can really make a difference then! Great to hear that you liked our suggestions, you’re very welcome. Good luck optimizing! :)

  12. Jen McNeil
    Jen McNeil  • 5 months ago

    Agreed with Mircea G., totally. Fabulous article, if the advice given works. One reads so much online these days, and there is such a huge amount of contradiction. For example, if you read that WPBeginner guy, you will for sure be disappointed. We also were running W3TC and Autoptimize, but the results were very disappointing. Likewise, we are doing some switching and experimenting with other WP PlugIns. We have faith in the Yoast Team, so let’s see them shine. Thanks for the advice Michiel. We’re gonna give it a whirl.

  13. Mircea G.
    Mircea G.  • 5 months ago

    Great article, thank you very much! I use W3 Total Cache for cache and Autoptimize for CSS and JavaScript compression, but ..still I’m not satisfied with my site speed. I have to switch to mentioned plugins to see the results.

    • Iris Guelen
      Iris Guelen  • 4 months ago

      You’re welcome, Mircea. Let us know how it goes if you decide to try any of the plugins? Good luck!


Check out our must read articles about Image SEO