WooCommerce Add To Cart Slow
Article template, showing the real published article KB 790 in the new design. Category, related articles and the report call to action are the template parts.
A slow add to cart is one of the most expensive speed problems a WooCommerce store can have. It hits your customers at the exact moment they’ve decided to buy. Every second they spend watching a spinner is a chance for them to give up and leave.
It’s also easy to miss, because the rest of the site can feel fast. Here’s why it happens and the fixes that make the biggest difference, in the order we’d do them.
Why Add to Cart Is Slow When the Rest of Your Site Isn’t
Page caching makes most of your site fast by serving a saved copy of each page. Add to cart can’t work that way. Every click has to run PHP, create or update the shopper’s session and write to the database. That means an add to cart request exposes every weakness in your database, plugins and hosting that a cached page hides.
The WooCommerce Add to Cart Checklist
We’ve put every fix below into a free checklist you can copy and tick off as you go: get the WooCommerce add to cart checklist.
1. Back up first
Several of these fixes change your database and can’t easily be undone by hand. Take a full backup and make sure you know how to restore it. Here’s how to restore backups on WP Alpha.
2. Convert MyISAM tables to InnoDB
Older WordPress databases often still use MyISAM tables, which lock the whole table every time something is written to it. On a busy store, add to cart requests end up queuing behind each other. InnoDB only locks the row being changed. The free Servebolt Optimizer plugin converts your tables and adds useful database indexes in one click.
3. Enable High-Performance Order Storage (HPOS)
HPOS moves orders out of the general WordPress posts tables into dedicated order tables, so orders stop competing with every other query on your site. Turn it on under WooCommerce > Settings > Advanced > Features.
4. Turn on WooCommerce’s built-in performance features
On the same Features screen, enable Cache Product Objects (WooCommerce 10.5 and newer). WooCommerce’s own testing shows add to cart up to around 13% faster. It’s on by default for new stores from WooCommerce 11.0, so older stores usually need to switch it on. It’s still marked experimental, so test a checkout on a staging site first.
5. Put a CDN in front of your site and block bad bots
A CDN like Cloudflare takes a lot of load off your server. It’s also where you stop bots from hammering your add to cart links, which is one of the most common causes of a slow cart and 502 or 504 errors. Add these rules to your robots.txt file:
User-agent: *
Disallow: /*add-to-cart=
Disallow: /*add_to_wishlist=
Disallow: /cart/
Disallow: /checkout/
Disallow: /my-account/
Some bots ignore robots.txt, so also add a Cloudflare firewall rule under Security > WAF > Custom rules that blocks requests containing add-to-cart= from aggressive crawlers like AhrefsBot, SemrushBot, MJ12bot and Bytespider. Never block Googlebot or Bingbot.
6. Use Redis object caching
Object caching keeps the results of repeated database queries in memory, which speeds up exactly the uncached requests add to cart relies on. It’s available on WP Alpha hosting: here’s how to set up Redis object caching.
7. Check for PHP errors with Query Monitor
Install the free Query Monitor plugin, then add a product to your cart and check the PHP Errors panel. A warning that fires on every request slows everything down. You can also turn on WordPress debug mode to log errors.
8. Clear transients
Go to WooCommerce > Status > Tools and clear both the WooCommerce transients and the expired transients. On older stores these can add up to thousands of rows your database has to work through.
9. Update everything and check the WooCommerce database version
Keep WordPress, WooCommerce, your theme and plugins up to date. Then go to WooCommerce > Status and check the WooCommerce database version matches the WooCommerce version. If the database is behind, run the update from the notice in your dashboard.
10. Check your hosting and PHP version
Cheap shared hosting is a hard ceiling for WooCommerce, because the cart and checkout need real server resources on every request. Make sure your hosting is built for WooCommerce, and that you’re running PHP 8.1 or newer. Here’s how to change PHP versions on WP Alpha.
Your Checklist at a Glance
Back up first
- Take a full backup of files and database
Essential fixes
- Convert every MyISAM table to InnoDB using Servebolt Optimizer
- Enable High-Performance Order Storage (HPOS)
- Turn on WooCommerce’s built-in performance features
- Put Cloudflare or another CDN in front of the site
- Add robots.txt disallow rules for add to cart and wishlist URLs
- Add Cloudflare firewall rules to block the worst bots
- Check for PHP errors and warnings in Query Monitor
- Confirm a persistent object cache is connected, not just installed
- Clear transients
- Update WordPress, WooCommerce, the theme and all plugins
- Check the WooCommerce database version matches the installed version
Hosting checks
- Confirm your hosting is appropriately specced for a WooCommerce site
- Check PHP is version 8.1 or newer
Want it as a spreadsheet with impact ratings and step-by-step instructions? Open the free WooCommerce add to cart checklist.
Let WP Alpha Take Care of This for You
A slow add to cart is exactly the kind of problem we take care of with WP Alpha hosting. Our servers are built for WordPress and WooCommerce, with Redis object caching, easy PHP version upgrades, staging sites and automatic backups ready to go.
Moving from another host? We’ll migrate your site for free.
View WP Alpha Plans →Run the free report: pass or fail, 40 weeks of history, weekly emails.
Run the free report