WordPress performance quick start guide

Updated 28th September 2021

Solving WordPress performance issues is what Super Speedy Plugins is all about. Here’s what our founder has to say:

Fast websites make more money. When I optimise WordPress websites for clients, conversions go up, pages viewed per user go up, customer lifetime value increases and even inbound traffic from SEO gains a boost.

Dave Hilditch – founder, Super Speedy Plugins

How to identify your WordPress performance problems

So far, you’ve probably used GTMetrix or Pingdom or some other tool to scan your site. This tool will have told you to minify your CSS, compress or resize your images, remove blocking javascript and join javascript files together to make them quicker to download.

But you still have a slow site, so what figures? Speed-testing tools can’t see the activity that’s happening on your server. If you still have a slow site, it’s because you have a large TTFB. That’s Time To First Byte. In human, it’s your raw page speed, the amount of time between when the page was requested and the first response comes back from the server.

A long TTFB not only hurts individual page speed, it also hurts your ability to scale. There’s only so much server resource available, so if your TTFB is 4 seconds – instead of 100 milliseconds, that means you can handle 40 times less traffic capacity – fewer simultaneous users on your site. Worse, as more people arrive to your site, your TTFB is going to increase significantly as your server thrashes about trying to serve up pages.

To be able to view your TTFB on every page of your site, and to spot the sources of performance problems, install the Query Monitor plugin.

Caching

The most critical thing you can do immediately is to sort out your caching. Caching does not need to be complicated – there are 2 key things you need:

1) Page Cache

If you have a large TTFB, you should set up page caching immediately. This will mean the 2nd+ visitors to a page will get a TTFB of 100ms or less. It will also free up server resource so that the TTFB can drop for other pages – instead of your server generating 100 pages, a unique page per user every time, with page-caching, it only needs to generate 10. That gives you 10x more capacity right there.

Note: These figures are totally dependent on how many pages are re-used by your visitors. If they’re all concentrated on one page, you’ll see MASSIVE improvements with page-caching. If they are spread out over hundreds or thousands of pages, you’ll see less benefit.

For page caching, the best option is to use server-based caching e.g. Nginx fastcgi-cache, or some page-caching system offered by your hosting company. These will always be faster and more efficient than any WordPress page-caching plugin. If your hosts don’t offer page-caching of some kind, change hosts or follow our stack building guide to get the highest performance at the lowest cost.

If you insist on using a WordPress plugin for page caching then you can use WP-Rocket, W3 Total Cache, or a myriad of other page caching plugins. Page caching is trivial to code, so there’s not much they can do wrong but you should at least use a plugin that will selectively wipe page cache entries when posts or products are updated, rather than wiping the entire page cache. 

2) Object Cache

WordPress plugins are getting better at using the object cache properly, so get Redis installed onto your hosting (most hosting offers it) and configure your object cache. As you move from page to page, if you have the Query Monitor plugin running, you’ll see the number of queries used per page dropping. See our stack building guide to ensure your hosting provides you with an in-memory Redis cache. You don’t need Redis to be writing to disk, and it will make it slower.

Object caching eliminates repeated SQL queries *and* repeated PHP code to manipulate the results of these queries into a PHP object. That means you’re reducing disk usage and CPU usage.

For Object caching you can use the free Redis Cache plugin by Till Kruss, or if you’re using W3 Total Cache you can enable it in there.

If you are using WP Rocket, it doesn’t include an object cache so you should add the Redis Cache plugin too. They complement each other well.

Slow WooCommerce Shortcodes and Filters

If you’re using WooCommerce shortcodes (products on sale, best sellers, most popular products) or any WooCommerce filters then you’ll be seeing a very high query count in Query Monitor on your slow pages.

Object caching should help in many cases, but you’ll still have slow first page loads for many of your pages. You may not know you’re using these shortcodes – if, for example, you’re using a page builder like VS Composer, WP Bakery, Elementor or any of the others then they may have inserted the shortcodes for you, or they may even be built into your theme options.

Super Speedy Plugins Plugins

Because of how slow other WooCommerce filters and shortcodes are we ended up coding our own plugins to speed things up.

Scalability Pro speeds up the main WP_Query in your archive (any post type) as well as many wp-admin speed improvements to make administering your site faster and less annoying.

Faster Woo Widgets adds ultra-fast replacement WooCommerce filters with advanced shop archive SEO functionality – if you’re building a store and you want it to be fast and scalable enough to handle proper GoogleBot and other SEO indexing bots then you need to get Faster Woo Widgets.

Super Speedy Search was created to replace the slow and inaccurate search provided by other search plugins. It gives instant search results as you type across multiple taxonomies and post types.

When I say slow, just so’s you know, I test everything against a demo store with almost 1 million products and many of our earliest customers have over 1 million products or posts in their websites and they’re still getting the same speed today that they got when they had 1000 products because of my plugins. I aim to get everything sub-second and to feel instant. If I load other filtering plugins onto my million product store, they take over a minute to generate each shop archive page.

Fixing Slow Imports

If you have slow imports, my Scalability Pro plugin will help a LOT, especially once your store or import files get larger, but you should also check out my article on the WordPress image sizes problem.

All of the plugins you’ve installed over time, many of them have registered new image sizes and they don’t delete them when you deactivate them. It’s not uncommon for websites to have 30 image sizes registered. That means, when you import something, the image for it will be resized into 30 different sizes and stored in your uploads folder. That’s a lot of extra CPU for resizing and a lot of disk for storing the images.

Fix the image sizes for your site using my guide above and use our Scalability Pro plugin for 10-fold+ speed boosts on large imports. Scalability Pro speeds up imports by deferring term counts until the import has completed and speeding up wp_postmeta lookups which import tools use to check if they should update or insert an item. Check our reviews to see for yourself.

For the ultimate in import speed, eliminate images from your site altogether with our External Images Plugin.

Hosting

What matters most from your hosting company is the stack they provide you and options to clone your site and create dev/staging areas to try out new things. Then it’s down to whether they provided managed or self managed services and the level of support they provide. Here are the key essentials you need:

  • SSD disks (not HDD)
  • 1GB ethernet (not 100Mbps)
  • PHP 7+ (not PHP 5.6)
  • MariaDB or PerconaDB or MySQL 8 (not MySQL 5.6)
  • Redis in-memory mode (for your object cache)
  • Nginx scales better than Apache, but this is less relevant than the other items above, Litespeed is also good
  • An HTTP accelerator – it could be varnish, or nginx fastcgi_cache or some other accelerator. Cloudflare can also help here or MaxCDN too.
  • A CDN – like Cloudflare or MaxCDN. Use their features to compress and minify your CSS and to change browser expiry dates for static files to a year from now.

Generally, if you follow the WordPress Speed Up group and Advanced WordPress groups on Facebook, people tend to prefer Gridpane, RunCloud, Cloudways, Siteground and WP Engine. 

If you want the highest performance at the lowest monthly cost and have the skills to DIY, check out my comprehensive WordPress stack building guide. I use Digital Ocean, but you can use AWS, Google or wherever you like and get amazing performance for very little money.

Upgrading your current hosting

From the list above, if you have PHP5.6 get that upgraded now! PHP 7+ is 3x faster than PHP5.6. If you have a lot of PHP time being used on your site, this will make a massive impact.

Second would be getting Redis for your object cache.

Third would be upgrading to MySQL 8 or MariaDB.

Fourth would be adding a CDN.

If after all that, your speed is acceptable, then it’s ok to stay with your current hosts.

Improving your page generation speed

Page-caching can’t help you much if you have 1000s of pages. Googlebot will not be getting the cached page, as it does not behave like a user and instead trawls through every page. There are two key issues that cause slow page generation speed.

Too many SQL queries

You may find that as your tables get larger, the number of queries per page increases. This is because some plugins are badly coded and even though they’re only displaying 20 items, they process every item in your database. This includes the official WooCommerce shortcodes for products on sale, best selling products, most popular products and it includes the official attribute widget and the official price filter widget from WooCommerce.

Object caching can help reduce the number of queries, but really you should either eliminate these shortcodes and/or widgets, or replace them with superior shortcodes/widgets that do not case an increase in SQL queries as your DB size increases.

These problems are why I created Faster Woo Widgets.

Slow SQL queries

If you have a large database with large order volume, or large product volume, or large comment volume, or large user counts, then queries will get slower and slower as your site grows. This is because of something called ‘table scans’. I’ve discussed this before on stack overflow.

I built the plugin Scalability Pro specifically to solve and eliminate table scans. It does this by adding good indexes to tables and rewriting some queries to ensure they use the indexes.

Speeding up CSS, JS and page rendering speed

If you’re keen to get high Pingdom or GT Metrix scores, you’ll need to optimise your CSS and JS. We don’t focus too much on that ourselves, we believe what matters is user perceived speed. However, in many cases the rules provided by GT Metrix et al to optimise your site help improve perceived speed.

There are a variety of asset optimisation plugins you can use to help get you better Pingdom scores but the best approach would be to use a CDN which provides image, CSS and JS optimisation. Many CDNs also offer page caching meaning you can keep even more load off your WordPress server.

Optimising your own site

Start with the Query Monitor plugin – look for high query counts, slow queries and queries that return a lot of rows. Experiment on your dev/staging clone (ask your hosts for one!) by deactivating plugins which show high numbers in the above. Test them with Redis enabled and disabled.

Once you’ve found bad plugins, you can either find alternatives or disable their functionality where they’re not needed using the Asset Cleanup plugin. You’ll find it in the WordPress repository. Many plugins run slow code on every page, so deactivating them until needed can really help reduce load on your server and speed up everything. You could also contact the plugin developers and screenshot your performance issues and provide them with proof that their plugins are slowing your site down.

Speeding up your wp-admin is harder – an object cache can help, but sometimes it does the opposite if a plugin is badly coded or perhaps if you have too many or too large options in your wp_options table. Check out my Knowledge Base article on managing your wp_options table.

Getting more help

We have tons of guides here on Super Speedy Plugins. Our mission is to make performance and scalability easy and available for everyone. Read our articles, browse our knowledge base, but if you can’t find what you need or you just want some personalised help then you can find me – Dave Hilditch – on our Discord server almost every day! Visitors welcome 🙂

14 Comments
  1. Interesting ! Thank you ! I hope to receive comments by Email.

  2. Can you give me a little more insight as to why we want to change the CloudFlare Browser Cache Expiration to 1 year and not 4 hours or even 1 month? Thanks and I love your plugins.

    • 1. WordPress adds a version number to static files when they are updated, this bypasses any cache age
      2. Page-speed tools like gtmetrix etc are far happier if you have longer cache duration for static files
      3. It really depends how frequently visitors use your site. If they’re likely back within a year, 1 year is good.

      But yeah – 1 year rather than 1 month was picked because of recommendation from gtmetrix.

      • Thanks, I was concerned that if we set it longer than even a few hours or a week that visitors might not get new content or updates to page changes on say a home page or landing page. However after a careful read of this great post I found by Chris Ahson, I think I get the bigger picture now.

        https://ashton.codes/set-cache-control-max-age-1-year/

        • Yeah cool – he makes a really good point about browsers being fairly forgetful – people have small caches, so often wont cache more than a weeks worth of data – but the CDN between the browser and your server is NOT forgetful and with a long-term cache you’re alleviating load from your own server.

  3. Type: Scrapy Cloud is by Scrapinghub, not Parse Hub

  4. Wow ,this is the content I am looking for the past few weeks. Perfect solution for a faster wordpress website.

  5. Optimizing WordPress performance is a lot of work 🙂 Thanks for explaining it in simple manner.

  6. Hey Dave, that’s very wonderful and helpful.

Leave a reply

WP Intense
Logo