Have a slow WooCommerce site?
You can speed up a slow WooCommerce site by clearing customer sessions, deleting transients, and optimizing WooCommerce scripts, styles, cart fragments, and product images. Increasing memory limit to 256MB and using good cache plugin with a CDN are recommend. Cloud hosting is also much faster at loading heavy WooCommerce resources than shared hosting.
Is my site WooCommerce? No. But my developer and I have made multiple WooCommerce sites to typically load 3x faster. And if you need help, you can hire him on freelancer.com for $40/hour. He has a perfect 5 star review, an extensive portfolio of websites he’s optimized. I’ve been working with him since 2011 (his name is Pronaya) and can’t recommend him enough.
Otherwise, follow this guide and feel free to post questions (or your results) in the comments.
How To Speed Up A Slow WooCommerce Store
- Disable Cart Fragments
- Disable WooCommerce Styles
- Disable WooCommerce Scripts
- Clear Customer Sessions
- Clear WooCommerce Transients
- Disable The WordPress Heartbeat API
- Use A Lightweight WooCommerce Theme
- Resize Product Images To Smaller Dimensions
- Don’t Use Too Many Extensions
- Use A Better Cache Plugin
- Avoid Resource-Hungry Plugins
- Delete Unused Themes + Deactivated Plugins
- Compress Images With ShortPixel
- Clean Your WooCommerce Database
- Clean Your WordPress Backend With Clearfy
- Block Bad Bots
- Upgrade To PHP 7.4
- Combine Google Fonts
- Setup Cloudflare’s Free CDN
- Pinpoint The Problem With Query Monitor
- Ignore Google PageSpeed Insights (Use GTmetrix)
- Check CPU Usage And Server Response Times
- Avoid EIG Hosting + GoDaddy
- Use Fast Hosting That Can Support WooCommerce
1. Disable Cart Fragments
The easiest way to disable WooCommerce cart fragments, scripts, and styles, is with Kinsta’s perfmatters plugin. It also lets you disable unused widgets (including WooCommerce widgets) to make the admin load faster and has other features like disabling the WooCommerce status metabox, disabling scripts on a page/post basis, limiting post revisions, autosaves, heartbeat control, and other things that can reduce CPU and make your WooCommerce site load faster. If you don’t want to pay $25/year, I listed alternative methods below (using code from Github).
By default, WooCommerce uses cart fragments which is used to update the shopping cart without refreshing the page. But this isn’t needed on your homepage (or other pages) and can be disabled for better performance. Otherwise, cart fragments will load on every single page.
What cart fragments will usually do to your GTmetrix/Pingdom report:
To disable cart fragments, add the code to your funtions.php file:
2. Disable WooCommerce Styles
WooCommerce loads 3 stylesheets on every page of your website. Since you probably don’t want these loading on every single page, you should disable them on non-eCommerce content.
Disable all WooCommerce stylesheets:
Disable specific stylesheets:
If you disabled specific stylesheets, you will need to add your own:
3. Disable WooCommerce Scripts
WooCommerce also causes lots of scripts:
The solution below only loads WooCommerce scripts on the shop, checkout, and cart pages.
Add this to your functions.php:
If that doesn’t work, there are a few alternative solutions on Github people had success with.
perfmatters also lets you disable scripts on specific pages. For example, I don’t need my rich snippet or Thirsty Affiliates plugin loading on my homepage, so I disabled it. Selectively disabling scripts/plugins to load on specific pages can reduce load times.
4. Clear Customer Sessions
In your WooCommerce Status settings, clear customer sessions:
5. Clear WooCommerce Transients
In your WooCommerce Status settings, delete all transients:
6. Disable The WordPress Heartbeat API
The WordPress heartbeat API shows you real-time plugin notifications, and when other users are editing a post. This generates a request every 15-60 seconds and will drain CPU, so it’s best to use a plugin like Heartbeat Control plugin to disable it, or at least limit it to 60 seconds.
If using WP Rocket, they also have an option for this:
7. Use A Lightweight WooCommerce Theme
I always recommend StudioPress themes which are also recommended by Matt Cutts and even Matt Mullenweg. Many themes, including Avada, are bloated with unnecessary features, and some themes may not be coded or maintained well. StudioPress is supported by a reliable team (recently acquired by WP Engine) with documentation, frequent updates, support, and coded with speed, SEO, and security in mind. I use their Outreach Pro theme and am loving it.
Themes I recommend from ThemeForest:
8. Resize Product Images To Smaller Dimensions
This is what serve scaled images means in GTmetrix.
GTmetrix tells you which images are too large, and the correct dimensions they should be resized to. Save the image from GTmetrix, resize it to the correct dimensions, and replace the old image with the new one. Do this with all oversized images on your WooCommerce site.
I suggest starting with images that appear on multiple pages (eg. logo + sidebar images) then working your way through individual pages, since GTmetrix only shows image errors for the single page you test. I also recommend creating an “image cheat sheet” as I’ll explain below.
Create a cheat sheet for your most commonly used images:
- Slider images: 1903(w) x 400(h)
- Carousel images: 115(h)
- Widget images: 414(w)
- Fullwidth blog post images: 680(w)
- Featured images: 250(w) x 250(h)
9. Don’t Use Too Many Extensions
Just like plugins, too many WooCommerce extensions will make your website slow:
10. Use A Better Cache Plugin
There are 3 factors when it comes to cache plugins:
- If you’re using a cache plugin
- Which cache plugin you’re using
- Whether you’ve configured the optimal settings
For free, I recommend either Swift Performance or WP Fastest Cache. But if you’re willing to drop $49, WP Rocket was rated #1 in most Facebook polls. That’s because it comes with a ton of features most cache plugins don’t, in which case you would need about 6 additional plugins:
- Database cleanup (built-in to WP Rocket, or use WP-Optimize)
- Heartbeat control (built-in to WP Rocket, or use Heartbeat Control)
- Lazy load images/videos (built-in to WP Rocket, or use WP YouTube Lyte)
- Host Google Analytics locally (built-in to WP Rocket, or use CAOS For Analytics)
- Optimize Google Fonts (built-in to WP Rocket, or use CAOS For Fonts, or SHGF)
- Integration with Cloudflare + other CDNs (built-in to WP Rocket, or use CDN Enabler)
11. Avoid Resource-Hungry Plugins
These are the most common plugins that drain CPU, but there’s a full list of them.
High CPU plugins usually include social share, statistic, calendar, page builders, chat, and plugins that run ongoing scans/processes or appear multiple times in GTmetrix.
- AdSense Click Fraud Monitoring
- All-In-One Event Calendar
- Backup Buddy
- Beaver Builder
- Better WordPress Google XML Sitemaps
- Broken Link Checker
- Constant Contact for WordPress
- Contact Form 7
- Contextual Related Posts
- Digi Auto Links
- Disqus Comment System
- Divi Builder
- View Full List Of 65 Slow Plugins
You can also find slow loading plugins in your GTmetrix Waterfall chart. If they appear multiple times, take a long time to load, or generate multiples requests, you will know something’s up.
Or use Query Monitor (check the “queries by components” tab):
You don’t need that many plugins!
12. Delete Unused Themes + Deactivated Plugins
All themes and plugins you don’t used should be deleted. Deactivated plugins and unused themes store settings in your database and are unnecessary. If you’re not using it, delete it!
13. Compress Images With ShortPixel
This is what optimize images means in GTmetrix.
I use ShortPixel which is what one of the most popular image optimization plugins, with Imagify, Kraken, and Smush also being popular. All these plugins do the same thing – compress images, strip EXIF data, and optionally resize images that are too large. Once you’ve configured the settings, compress a few images in the Media section. If you’re happy with the quality, bulk compress all images on your site. Though, I would still take a backup just in case.
Check out my full guide to optimizing images in WordPress for more tips.
- Serve scaled images: resize large images to correct dimensions
- Specify image dimensions: specify a width/height in the image’s HTML or CSS
- Optimize images – losslessly compress images
- Combing images using CSS sprites – combine multiple images into 1 image
- Avoid URL redirects – don’t serve images from wrong www or http(s) version
- Use a content delivery network – serve images/files from a CDN
- Leverage browser caching – cache images/files using your cache plugin
- Make favicon small and cacheable – use a 16x16px favicon and cache it
14. Clean Your WooCommerce Database
You can use WP-Optimize or WP Rocket to schedule a database cleanup every 1-2 weeks. This deletes garbage files like expired transients, spam comments, pingbacks, trackbacks, database tables, drafts, and the potentially thousands of post revisions that accumulate over time (that is, if you don’t use plugin like permatters to limit them). Always take a backup before doing it!
15. Clean Your WordPress Backend With Clearfy
There’s a lot of stuff built-in to WordPress you probably don’t need. Clearfy can help you clear it up. You can usually disable jQuery Migrate, RSD links, wlwmanifest link, shortlinks, post revisions, autosaves, heartbeat, dashicons, and many other options. Perfmatters is good too.
Kinsta’s permatters plugin is similar, but comes with even more features:
16. Block Bad Bots
Are bad bots crawling your site and consuming CPU? They were for me, a lot of them actually.
Step 1: Install Wordfence.
Step 2: View your live traffic report.
Step 3: Find spam bots in your live traffic report (if the same bot is constantly hitting your site and looks suspicious, Google it’s hostname and see if other people reported it as spam).
Step 4: Block the spam bots.
Wordfence itself can cause high CPU (but is good for seeing IF you have spam bots). I recommend blocking them using the Blackhole For Bad Bots plugin, or with Cloudflare firewall rules. Wordfence and Cloudflare have a log so you can see whether the bots are actually being blocked. If successful, you can uninstall Wordfence and use Cloudflare or the Blackhole plugin.
17. Upgrade To PHP 7.4
WooCommerce sites should always be running a fast PHP version (eg. PHP 7.4) which you can upgrade in your hosting account. Higher PHP versions make your site run much faster, even though most WordPress users run outdated PHP versions (since they don’t know how to do it).
Check which PHP version you’re currently running in the Status section of WooCommerce:
Then upgrade to PHP 7+ in your hosting account:
Some plugins are not always compatible with higher PHP versions (another reason you should be careful which plugins you use). Run the PHP Compatibility Checker to make sure your plugins are compatible. If they are, you can safely upgrade, but check your website for errors.
18. Combine Google Fonts
Google Fonts are external resources and will show up in your GTmetrix/Pingdom report:
Option 1: Install Autoptimize and use “Combine and link in head” option:
Option 2: Try the CAOS for WebFonts plugin:
19. Setup Cloudflare’s Free CDN
There’s absolutely no reason you shouldn’t be using Cloudflare’s CDN.
It hosts your website on 200+ data centers across the world. This reduces the distance between your server and visitor, while offloading resources to their data centers (putting less stress on your origin server). Cloudflare is easy to setup – sign up for a free plan, run the scan, and they will assign you 2 namesevers which you will change in your hosting account. You can do other things with Cloudflare like enable hotlink protection, Rocket Loader, and utilize page rules to make your WooCommerce site even faster – all done in your Cloudflare dashboard.
Multiple CDNs = more data centers = faster delivery of your content. If you want to go the extra mile, use both Cloudflare and a CDN like StackPath (I use both). StackPath has 31 additional data centers. While Cloudflare requires you to change nameservers, StackPath (and other CDNs) will ask you for your website, then generate a CDN URL which you will paste into your cache plugin (most have an option for this), or you can also use the CDN Enabler plugin.
20. Pinpoint The Problem With Query Monitor
Query Monitor has a ton of information that can help you debug why your WooCommerce site is slow. It shows you slow loading queries, PHP errors, hooks and actions, block editor blocks, enqueued scripts and stylesheets, HTTP API calls, and more. Fixing items in Query Monitor may require some technical knowledge, but is worth hiring a developer who can fix the issues.
You can also use AWStats (commonly found in the “statistics” section of your hosting count which tells you which bots, images, files, and other elements that are consuming the most CPU.
21. Ignore Google PageSpeed Insights (Use GTmetrix)
If you join the WordPress Speed Up Facebook Group, or look at WP Rocket’s article, you’ll learn that Google PageSpeed Insights is not a great tool for measuring (or optimizing) your site – it doesn’t even measure load times! Pingdom is one of the most accurate tools for measuring load times, but for actual performance recommendations I (and most people) prefer GTmetrix.
When testing your WooCommerce site, always check your GTmetrix Waterfall chart to see which requests take longest to load (eg. WooCommerce cart fragments, specific plugins, etc).
The only thing Google PageSpeed Insights is good for is measuring server response times:
22. Avoid EIG Hosting
The same company (EIG) owns over 60 different hosting companies. It is well-known in Facebook Groups that they pack too many people on the same server, use outdated PHP versions and speed technology, and don’t care about clients. Cheap hosting = cheap results.
- Are you using an EIG brand (Bluehost, HostGator, Site5, iPage, HostMonster)?
- Are you running your WooCommerce site on a $4/month hosting plan (eg. GoDaddy)?
Don’t expect a WooCommerce site to be fast on a cheap hosting plan, let alone have a decent server response, time to first byte, and enough CPU to compensate for lots of extra plugins. Generally, WooCommerce sites need a better hosting plan to compensate for more plugins, scripts, and CPU usage. And EIG, GoDaddy, and other low quality plans aren’t going to cut it.
23. Check CPU Usage And Server Response Times
24. Use Fast Hosting That Can Support WooCommerce
Shared hosting may not have enough server resources especially if you’re running high CPU plugins, page builders, Google AdSense, or get a decent amount of traffic. And it’s especially not a good idea to run WooCommerce or WPML on shared hosting since they are resource-hungry.
Hosting recommendations are usually garbage.
Yes, it’s a little more expensive at $10-$13/month, but we’re talking about speed here – not being cheap. With Cloudways, you have a choice of using DigitalOcean, Vultr High Frequency, Google Cloud, AWS, or Linode. These are worlds faster than shared hosting and can handle resource-intensive tasks much better (Elementor, Beaver, Divi, WooCommerce, AdSense, etc).
Here’s what happened when I moved:
GTmetrix tests are always different, but even posts with a huge page 2.70MB page size and 96 requests can often load in under 2s. I’ll also take a 148ms time to first byte any day of the week. That post has 70+ images, 480 comments (showing Gravatars), Font Awesome, and Elementor.
The evidence is there:
This was a simple Pingdom test to measure load times of 16 WordPress hosts. I signed up for popular hosting companies then installed the same Astra Starter Site on each of them while measuring load times in Pingdom for 1 week at 30 minute check intervals. Some domains are still live (cwdoserver.com is hosted on a $10/month Cloudways DO plan and stgrndserver.com is hosted on SiteGround GrowBig). I cancelled most of them because it was getting expensive. Even when browsing through their pages or running your own tests, you can see the difference.
Hosting Companies You Should Avoid
- SiteGround – they have gone completely downhill in recent years.
- Bluehost – slow servers, owned by EIG, bad support, rated poorly in FB Groups.
- HostGator – also owned by EIG with slow servers, bad support, CPU limit issues.
- GoDaddy – top malware hosting network worldwide, rated poorly in FB groups.
- Hostinger – they write fake reviews and vote for themselves in Facebook polls.
- WP Engine – also not what it used to be, expensive and not even fast anymore.
- *A2 Hosting – if you can’t afford Cloudways, A2 is still fast and uses LiteSpeed.
I use Cloudways because:
- Even posts with a 2.70MB page size can load in under 2s
- DigitalOcean and Vultr HF are miles faster than shared hosting.
- It’s $10-$13/month (no yearly contracts or high renewal prices).
- Varnish, Redis, and memcached are all built-in for higher performance.
- You get to pick from DigitalOcean, Vultr HF, Linode, AWS, Google Cloud.
- 4.8/5 star TrustPilot rating and highly recommended in Facebook Groups.
- They have 25+ data centers between all their cloud hosting providers.
- No CPU issues like on SiteGround, Bluehost, and other shared hosting.
- SSL, staging, and backups are all very easy in the Cloudways dashboard.
- Support used to be average, but is now really good as reflected on TrustPilot.
- They offer a free migration but their Migrator plugin will also do the trick.
- Adding a server, migrating your site, and the dashboard is actually very easy.
- Mustasaam (their community manager) gave me peace of mind when moving.
- Only complaint is they need to add LiteSpeed servers to their list of providers.
Affiliate Disclaimer – if you sign up for Cloudways using my affiliate link, I would seriously appreciate it. I don’t recommend bad hosting like many other affiliates. I also donate quite a bit to charity ($6,000 to GoFundMe so far) and your support would really help. I try to base my reviews not only from my experience, but real evidence from the overwhelming feedback in numerous Facebook Groups. It would mean a lot.
Just do your research and look at this Facebook thread.
Frequently Asked Questions
🚀 Why are WooCommerce sites slow?
WooCommerce are naturally slower because they have extra WooCommerce scripts, styles, and cart fragments. They also usually requires more plugins. That's why most WooCommerce sites have poor load times and scores in GTmetrix.
🚀 How do you optimize cart fragments?
You can use the Perfmatters plugins to optimize WooCommerce cart fragments, scripts, and styles.
🚀 What are the 5 most important speed factors?
Skip shared hosting all together and go with cloud hosting, upgrade to the latest PHP version, reduce and consolidate plugins, and optimize images + external fonts using plugins like ShortPixel and OMGF. Using a CDN and cleaning the database helps too.
🚀 How do you optimize product pages?
Optimizing images is the most important part of making individual product pages load faster. There are 3 main ways to optimize images in GTmetrix: serve scale images (resizing them to correct dimensions), compress images using a plugin like ShortPixel, and specify image dimensions in the HTML. Remove EXIF data and serve images from a CDN as well.
🚀 What if you're running lots of plugins?
If you are running lots of plugins, especially if they are not lightweight (see my list of slow plugins), you will need to make sure all other elements of your site are completely optimized and that you're using faster hosting to support the website's resource needs.
I hope this helped! Comment if you have questions.