Solving WordPress performance issues is what WP Intense 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, WP Intense
How to identify your WordPress performance problems
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.
- Query Monitor plugin
- GTMetrix page speed tool
- Pingdom page speed tool
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 you can use the WP-Rocket plugin. It’s the easiest to use. If you feel more confident, you can use the W3 Total Cache plugin for your page caching.
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.
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 Redis Cache plugin, or if you’re using W3 Total Cache you can enable it in there.
- WP Rocket Plugin (for page caching)
- Redis Cache plugin (for object caching)
- W3 Total Cache (handles both page and object caching if you can handle the complicated settings pages)
WooCommerce Shortcodes, Attribute widget and Price widget
If you’re using WooCommerce shortcodes (products on sale, best sellers, most popular products) or the WooCommerce attribute or price widgets then you’ll be seeing a very high query count in Query Monitor on your slow pages. Object caching should help, 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 then they may have inserted the shortcodes for you, or they may even be built into your theme options.
Consider removing the shortcodes or replacing them with our fast ones.
- Faster Woo Widgets plugin (by WP Intense)
- Super Speedy Sale Page for WooCommerce (by WP Intense)
If you have slow imports, our Scalability Pro plugin can help, especially once your store gets larger, but you should also check out our article on the WordPress image sizes problem. All the plugins you’ve installed over time, many of them have registered new image sizes. 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.
If you would like even faster imports, check out our Scalability Pro plugin.
- WP All Import (the only import plugin we recommend because it’s the only one we’ve found that performs and scales)
- Datafeedr (a great import tool if you’re building an affiliate store)
- External Images plugin (by WP Intense – eliminates the need to store featured images on your server, speeding up imports and reducing storage requirements)
- Scalability Pro (speeds up product lookup and other slow-running import-related queries)
Your host doesn’t really matter. What matters is the stack they provide you. 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 cache mode (for your object cache)
- Nginx scales better than Apache, but this is less relevant than the other items above
- 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.
We recommend the following hosts, but any that provide the above items will do:
- WP Engine – they have built in object-caching and page-caching, and have 24×7 support to help you
- Digital Ocean – they have the best value for money. You’ll need to build a stack yourself however.
- Siteground –
- Cloudways –
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.
If you are thinking of moving hosts, go for WP Engine if you want your hand held and all the performance worries dealt with, or with Digital Ocean and one of our stacks if you want control and most bang for your buck.
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.
Object-caching can help quite a bit, but if you have a large database with large order volume, or large product volume, or large comment volume, then queries will be slow. This is because of something called ‘table scans’. I’ve discussed this before on stack overflow. [link to my stack overflow guide about table scans]. You may also 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
Object caching can help reduce the number of queries occurring whilst our plugin, Scalability Pro, was built to solve the table scan issues.
If you need it, you can find it here:
The (in)Complete Guide to WordPress Performance
Welcome to our WordPress performance guide
This incomplete guide to WordPress performance will grow organically over the coming weeks in response to your suggestions. I had been hoping to complete it before releasing, but I think getting it out there in incomplete form will help me complete it quicker.
Fast Websites Matter
Fast websites make more money. When I optimise 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.
The fact is, caching cannot solve every WordPress performance issue. Admin pages cannot be cached, pages for logged in users (your most profitable users!) cannot be cached, and when GoogleBot indexes your site, it does not behave like a normal user – instead of accessing only your most popular pages like your users do, it accesses EVERY page. That means the pages are likely not cached and GoogleBot will leave with a bad impression of the speed your site runs.
On large sites, you cannot cache everything and if you could, you still could not prime the cache for every page in a timely manner.
That means the underlying performance really matters. Your /shop/ page having a 0.2s database time rather than 10s database time really matters. Your wp-admin pages loading in 1 second rather than 20 seconds really matters. GoogleBot changing its opinion of your site to a FAST site really, really matters.
In the guide below, I’ve tried to include the free DIY approach for each performance area where possible as well as the BEST premium option and our own option if we have one.
I’ll be on our hullo chat system most days – come talk to me about performance.
Choosing a top quality host and a good hosting stack are the the first and most important part of improving your WordPress performance.
There are a large number of hosts to choose from – you should look out for hosts that use solid state disks (SSD) and which allow you to choose your operating system (e.g. Ubuntu 16.04).
We recommend Digital Ocean if you need a good SSD-based VPS.
WordPress Hosting Stack
Once you have a good host, you need a good stack. The stack is the underlying software upon which WordPress runs. It includes things like the PHP version, the MySQL version and the web-server version.
You should demand PHP 7 instead of PHP 5.6, either MariaDB or PerconaDB instead of MySQL 5.7 or even worse MySQL 5.6 or 5.5. You should also demand Nginx instead of Apache, fail2ban to protect your site at the top level and some kind of object cache – either Redis or Memcached will work well.
If you are uncertain which versions of these things you have with your current host, you can install the WP-ServerInfo plugin to find out.
Once you have these items installed, you should ensure they are configured correctly for optimal performance. See our DIY guides below for configuration ideas.
The Rocket Stack is our high-performance WordPress stack. It has all the tools you need, pre-configured, to run an ultra-high performance WordPress website.
We can install the Rocket Stack on any VPS provided it has a fresh copy of Ubuntu 16.04 installed and you have added our public SSH key to the server.
Rocket Stack Contents
Your server will be set up and configured with:
- Nginx – faster web engine than Apache
- Varnish – front-end caching engine configured for WordPress
- MariaDB – 100% compatible, faster than MySQL
- PHP7 – about 3 times faster than PHP 5.6
- fail2ban – protects your site from botnets, reducing load
- Redis – used for ultra-fast object caching
- Free SSL for life using Letsencrypt
Technical DIY Guides
If you want to install a new stack yourself, you can follow our guides below:
- Guide to installing the Rocket Stack (coming soon)
- Guide to installing the Mercury Stack
- Guide to intalling a fast and easy stack using Server Pilot
We recommend Digital Ocean for your hosting – droplets commissioned in 60 seconds, full VPS capability, many locations throughout the world and a snapshot function which lets you clone your servers with no downtime. Take snapshots before major changes, or clone your high performance rigs for fresh websites.
Digital Ocean use SSD solid state disks which are 20 times faster than HDD hard disks and you get useful server admin functionality from their website – like access the console, reboot, check CPU/DISK usage and more.
You can install our ultra-fast Rocket Stack on your Digital Ocean droplet, or you can DIY build your own stack using one of our DIY guides.
Or an even simpler approach – when you are creating your droplet, Digital Ocean give you the option to create it from a WordPress image – this will get you a basic WordPress stack (not as fast as our Rocket Stack), but if you’re coming from a shared hosting environment or a non-SSD environment you’ll still see a significant speed boost. Good if you’re on a budget.
You get $10 credit which is enough for their smallest droplet for 2 months through the affiliate link below.
Scaling refers to your fast website remaining fast when you have huge traffic spikes and also refers to your fast website remaining fast when you have millions of products, posts or pages.
Traffic spikes are actually fairly trivial to deal with as they tend to hit one or two of your pages. This means that you can take advantage of things like page-caching, image-caching, static-file-caching and CDN caching to serve up that content quickly to all these visitors without them having to hit your WordPress website at all.
To ensure you survive traffic spikes, get yourself a decent CDN and a decent page-caching plugin that supports Varnish. Configured correctly, your CDN and Varnish will ensure these traffic spikes get served without even running any PHP code to serve up your content.
Scaling in Size
If you are scaling in size – millions of products, posts, pages or users – the most important point to note is to avoid table scans. Table scans occur when poorly written code forces MySQL to read every product, post or user in order to generate your page. If this is occurring on your site, you will not be able to scale in size without spending inordinate amounts of money on hosting.
In order to solve growth-scaling, we’ve developed a plugin to optimise your website and ensure table scans do not occur.
It includes specific code and widgets for WooCommerce to ensure you can scale your stores to millions of products.
It includes indexes and sql alterations to ensure your back-end admin operates faster and scales.
It also includes significant speed and accuracy improvements for free-text search.
Scalability Pro doesn’t include page-caching, so in addition to it you should choose one of W3 Total Cache, WP Super Cache and WP Rocket.
Far and away this is the best caching plugin available but you do have to pay for it. It’s not costly though, and their feature-set far outweighs that of W3 Total Cache and WP Super Cache.
W3 Total Cache
Written by the CTO of Mashable – it’s my favourite, but it can be a little tricky sometimes.
Use it to enable page-caching using disk and object-caching using Redis.
Do not enable the minification features as I’ve found them to be buggy. If you want minification, use Cloudflare minification features.
WP Super Cache
For some reason, when this plugin is activated it has some broken settings. Visit the settings page immediately and ensure you are not caching pages for admin users.
Importing To Wordpress
Importing lots of products to WordPress can be painful. I hear stories of people managing to only import 5000 products per day.
1 million+ products imported per day is easily achievable.
Why is importing Slow?
Importing to WordPress is slow for really three key reasons:
- Items can only be inserted one at a time
- Table scans are happening
- Imported images need to be resized and saved
If you could simply import directly to the database, you could very easily achieve billions of items inserted in a day. WP All Import do provide an option to disable the do_action commands which can give you a little bit of a boost, but it’s still importing one at a time through PHP.
To avoid the table scans, use Scalability Pro – it has specific indexes for queries performed by various import plugins.
One technique to avoid importing images and speed up imports is to use our External Images plugin. This fools WordPress into thinking the image is stored locally when it’s in fact elsewhere.
If you are not an affiliate marketer, you can still take advantage of this plugin – get your images stored somewhere – e.g. Amazon S3 – and ensure your import file includes the URL to that image.
Technical DIY Guides
If you want to import vast quantities of data, we’re here to help:
Streets ahead of the competition, WP All Import lets you import posts/products from anywhere – CSV, JSON, XML – you can even give it a URL to read the data from, meaning you can point it any RESTful API.
The official WooCommerce CSV importer on the other hand fails dreafully – it forces you to create CSV files in its format whereas WP All Import doesn’t care about the format of your file. It will interpret it and let you drag and drop the fields from your file to your fields on your post/product/page.
Datafeedr is by FAR the easiest way to import affiliated products into your site. If you are using WooCommerce, you should use the Datafeedr API rather than the Datafeedr Factory.
Datafeedr are connected to pretty much every affiliate data feed in the world, so it’s a fantastic way of populating your niche affiliate store – you don’t need to bother with datafeeds at all – just search for the products you wish to add and either add them one by one or create search filters to add en-masse.
Scraping content to load into your site has never been easier. You can use any of the third-party services below to build an index for your scrape and you’ll end up with a URL where that scraped data is available.
Provide that URL to WP All Import and you can import data scraped from publicly accessible site in the world.
Theme & Plugin Performance
If you have covered all other bases – you have good hosting, you have Scalability Pro, you’re maybe using our External Images plugin too (for affiliates mostly) – if you have these covered, and you still have poor performance at scale, that leaves plugin and theme performance.
Here we guide you through identifying which plugins are causing you scalability and performance issues, and how to choose a good theme.
If a client of mine has a good hosting stack and Scalability Pro and they are still experiencing slow speed, it’s almost always another plugin I haven’t yet optimised.
To identify slow performing plugins, the process I follow is this:
- Install Query Monitor plugin – this gives me a page-speed in seconds on my admin bar.
- Click the page-speed – see if there are any slow database queries – if so, remove the related plugin or optimise it
- Scroll to the bottom and find how many SQL queries are performed by each plugin – if one has a huge amount, investigate and remove or optimise the plugin
If you don’t feel like using Query Monitor, the quickest way to find which plugins are causing scalability issues is to deactivate 5 plugins at a time and check the page again for speed.
If it’s the same speed, re-activate those 5 and de-activate the next 5.
Once you’ve get the page loading quickly, reactivate each of those plugins one-by-one and check page speed each time until you identify the culprit.
Please do let me know if you’ve found any crap plugins that kill your performance so I can add them to my plugin blacklist.
We highly recommend Themify themes. They are fast, highly configurable and come with a far better visual drag and drop interface than the awful Visual Composer we keep seeing everywhere.
If you suspect you have a slow theme, you can test this by switching your theme to the default WordPress 2017 theme. If you are worried, take a backup before hand, but switching your theme out and then back will be seamless (it’ll look ugly in the default theme but everything will go back to normal when you reactive your original theme).
Your best port of call if your theme is a problem is either to get the developers of the plugin to fix performance or change themes.
You can also find some great tips at the following resources: