Performance11 min readPublished: 20 Jan 2025Updated: 9 Nov 2026

How to Speed Up WooCommerce: A Complete Guide

WooCommerce is slow because carts and checkout cannot be cached. How to fix it: page caching rules, object caching, database clean-up and enough PHP workers.

G7Cloud Engineering
Platform team
Share:
Abstract diagram of dynamic cart traffic separating from cached page traffic
  • WooCommerce is slow mainly because the cart, checkout and account pages cannot be cached, so they run PHP and database queries on every request.
  • Cache the catalogue, skip the cache for cart and checkout by URL and cookie, and add an object cache so PHP stops asking the database the same questions.
  • Database bloat (expired transients, autoloaded options, sessions and Action Scheduler tables) slows every uncached request. Clean it monthly with WP-CLI.
  • Checkout spikes use up PHP workers when your store shares resources with other sites. A store in its own container keeps its capacity.
  • Measure before you optimise: time to first byte, cart fragment calls, and Query Monitor for slow queries and heavy plugins.

Why is my WooCommerce store so slow?

To speed up WooCommerce, cache the catalogue but not the cart, checkout or account pages, add an object cache such as Redis, clear out database bloat, trim heavy plugins, and give the store enough PHP workers of its own. That tackles the four usual causes: pages that cannot be cached, repeated queries, swollen tables and shared resources.

A blog can serve almost every visitor a saved copy of each page, so PHP barely runs. A shop cannot. The cart, checkout and account area are different for every visitor, so much of your traffic goes straight to PHP and the database. WooCommerce also adds product, order, session and stock data, so one page load can run hundreds of database queries.

100s
queries per uncached page

A busy WooCommerce cart or checkout can run hundreds of database queries per request, against a handful for a cached blog page.

Which WooCommerce pages can be cached, and which cannot?

Anything that looks the same for every anonymous visitor can be cached: the homepage, categories, products and blog posts. Anything personal cannot: the cart, checkout and My Account. A brochure site can serve 95% of requests from cache. A busy shop often cannot cache the pages that make it money.

Page typeCacheable?Why
Homepage, category, productYesSame HTML for every anonymous visitor
CartNoContents differ for each visitor
CheckoutNoOrder details, payment, the visitor's session
My AccountNoLogged in, with personal order history
Blog posts, static pagesYesSame for everyone

Cache anything identical for all anonymous visitors. Never cache anything personal.

WooCommerce also stores much more data than a blog. Every order writes rows to several tables, every visitor gets a session, and products carry variations, attributes and extra details. So the database grows quickly, and a caching plugin on its own will not make a shop fast. You need caching rules that respect the cart, less repeated database work, regular clean-ups and enough capacity for checkout spikes.

How do I cache WooCommerce without breaking the cart and checkout?

Cache the catalogue, and exclude the personal pages by URL and by cookie. Set your page cache never to serve the cart, checkout or account pages, and to skip the cache for any request carrying a WooCommerce cart or session cookie. Then test with an item in the basket.

When a visitor adds to cart, WooCommerce sets cookies such as woocommerce_items_in_cart and woocommerce_cart_hash, plus a session cookie starting wp_woocommerce_session_. Your cache must treat those cookies as a signal to skip. If it does not, one shopper can see another's cart, or an empty cart after adding an item. That is worse than being slow.

Cart fragments can flood admin-ajax

WooCommerce keeps the cart total in your header up to date with a background call (wc-ajax=get_refreshed_fragments). On some themes this runs on every page load for every visitor, and can become a large share of your PHP traffic. If your slow requests are mostly admin-ajax, this is the likely cause. Limit it to pages that show the cart, or cache its response briefly.

Pro Tip

After changing cache rules, test in a private browser window. Browse the catalogue (it should be fast), add an item, then reload the cart and checkout. If the basket count is ever wrong, your cookie rule is leaking.

Does object caching (Redis) speed up WooCommerce?

Yes, it is one of the biggest wins for a busy store. WooCommerce makes the same database lookups again and again. An object cache keeps those results in memory between requests (Redis is the usual choice), so PHP stops asking the database the same questions. On the cart and checkout, which cannot be page-cached, it is often the largest speed-up available.

It is not a cure for a swollen database or a plugin running a slow query on every page. It hides repeated work; it does not remove work that should not happen. Pair it with the clean-up and plugin audit below, and measure before and after.

How this works on G7Cloud

Every store on G7Cloud runs in its own container with its own database and its own Redis object cache, so the memory the cache uses is yours. See WooCommerce hosting for how each store is set up.

How do I clean up a bloated WooCommerce database?

Every uncached request reads from tables that may have grown far larger than they need to. The usual causes are expired transients (temporary cached values) and autoloaded rows in wp_options, a growing sessions table, Action Scheduler logs, post revisions and orphaned rows in wp_postmeta.

The most common hidden cost is autoloaded data. WordPress loads every row in wp_options marked to autoload on every request, so a plugin that stores large settings there slows every page. On busy stores, the wp_woocommerce_sessions table and the Action Scheduler tables (wp_actionscheduler_actions, wp_actionscheduler_logs) can reach hundreds of thousands of rows if nothing prunes them.

SymptomLikely causeFix
Slow admin and slow every pageLarge autoloaded wp_optionsFind big autoload rows, remove them or set autoload to no
Queries mention _transient_%Expired transients not clearedwp transient delete --expired
Huge wp_woocommerce_sessionsOld guest sessions not clearedLet WooCommerce's clean-up run, or prune expired sessions
Very large Action Scheduler tablesCompleted or failed actions not purgedPrune completed actions on a schedule
Enormous wp_postmetaOrphaned rows and old revisionsRemove orphaned rows, limit post revisions

Match the symptom to the table, then run that clean-up rather than a blanket optimise.

WP-CLI (the WordPress command line) makes routine clean-up one command each. wp transient delete --expired clears stale transients. wp db query lets you look at the biggest autoloaded options. wp db optimize rebuilds fragmented tables. Run the safe ones monthly and review the heavy tables by hand a few times a year. Our guide to trimming a large WooCommerce database covers it step by step.

Check autoload weight first

Run wp option list --autoload=on --format=count to see how many rows load on every request, and inspect the largest with a query ordered by LENGTH(option_value). If autoloaded data is over about 1 MB, fix that first, because it slows every uncached page.

How many plugins is too many for a WooCommerce store?

There is no magic number. What matters is the work each plugin does per page. Ten well-behaved plugins can be faster than three that each run a query and load their own CSS and JavaScript on every page.

WooCommerce extensions often load their files on every page when only one template needs them. A currency switcher, a wishlist, a reviews add-on and a page builder can each add scripts everywhere, so a product listing loads code it never uses. Query Monitor shows, for each page, how many queries ran, which plugin ran them, how long they took, and which files loaded. Find the plugin adding the most time on your key pages, and stop its files loading where they are not needed, so the wishlist script no longer loads on the checkout.

We cover the wider principle in why WordPress performance shouldn't depend on plugins. A leaner plugin list is usually the cheapest speed-up on a mature store.

How do I stop hosting limits slowing my checkout?

Give your store enough PHP workers and resources of its own, so a spike cannot use them up. A PHP worker is a process that handles one request at a time. Cached pages barely use them, but every cart, checkout and account request holds a worker until it finishes. When more of those arrive than you have workers, the rest wait, and shoppers see a checkout that hangs.

That is why a store can feel fine on a normal day and struggle during a sale. A marketing email sends a burst of shoppers straight to the cart and checkout, exactly the pages a cache cannot help with. On a plan with few workers, or one shared with other sites, the queue builds just when every sale counts.

Shared hosting hides the limit

On shared plans, the PHP worker limit is often hidden until you hit it, and a neighbour's traffic can use the capacity you were counting on. The result is a slow or failing checkout with no obvious cause on your own site.

On G7Cloud WooCommerce hosting, each store runs in its own container, so another shop's sale does not slow your checkout. Monitoring checks each site every minute and alerts you to a problem before a customer does.

What is a practical WooCommerce speed checklist?

Measure first, then fix the biggest cause you find, and measure again after each change. Watch time to first byte (TTFB, how long the server takes to start sending a page) on the homepage, a product, the cart and the checkout, because server slowness shows up there first.

StepWhat to doHow to check it worked
1. MeasureRecord TTFB on home, product, cart and checkout; open Query MonitorYou know your slowest page and its query count
2. Page cacheCache the catalogue; exclude cart, checkout and account by URL and cookieCatalogue TTFB drops; the cart shows the right items in a private window
3. Cart fragmentsStop get_refreshed_fragments running on every pageadmin-ajax traffic falls sharply
4. Object cacheTurn on a Redis object cacheCart and checkout TTFB and query counts drop
5. DatabasePrune transients, sessions and Action Scheduler; trim autoloadAutoload under about 1 MB; sessions table small
6. PluginsStop unused files loading; remove plugins that do not earn their placeFewer queries and files on key pages
7. CapacityMake sure you have enough PHP workers and resources of your ownCheckout holds up under a load test or a real sale

A repeatable order of work. Measure TTFB after each step so you know what helped.

If your logs show a flood of admin-ajax.php calls with wc-ajax=get_refreshed_fragments, that is cart fragments. The database slow query log catches the queries dragging on your busiest pages. For the Redis side, see object caching with Redis. Speed also affects sales directly, as how slow websites kill conversions explains.

Frequently asked questions

Why is my WooCommerce checkout so slow?

The checkout cannot be cached, so every request runs PHP and queries the database, and holds a PHP worker until it finishes. In a traffic spike you can run out of workers and requests queue. An object cache makes each checkout request cheaper, and enough PHP workers of your own stop the queue building during a sale.

Can you cache WooCommerce cart and checkout pages?

No. The cart, checkout and My Account are different for every visitor and must never be page-cached, or one shopper can see another's cart. Exclude them by URL and by cookie (skip the cache for any request with woocommerce_items_in_cart or the wp_woocommerce_session cookie), then speed them up with an object cache instead.

Does Redis object caching make WooCommerce faster?

Yes, usually by a lot on a busy store. WooCommerce repeats the same database lookups, and an object cache keeps the results in memory so PHP stops asking again. It is often the biggest win on the cart and checkout. It does not fix a swollen database or a slow plugin query, so pair it with a clean-up.

How do I clean up a bloated WooCommerce database?

Clear expired transients with wp transient delete --expired, trim autoloaded rows in wp_options, and remove old rows from the sessions and Action Scheduler tables. Limit post revisions and remove orphaned postmeta. Run the safe clean-ups monthly with WP-CLI and review the heaviest tables a few times a year.

How many plugins can a WooCommerce site have before it slows down?

There is no fixed limit. What matters is the work each plugin does per request. Ten light plugins can beat three that each run queries and load files on every page. Use Query Monitor to find the plugins adding the most time on your key pages.

What causes high TTFB on a WooCommerce store?

A high time to first byte usually means the server does too much per request: no object cache, a swollen database with heavy autoloaded options, a slow plugin query, or too few PHP workers so requests queue. Measure the cart and checkout separately from the catalogue, since those pages skip the cache.

Put this into practice on G7Cloud

Every site runs in its own dedicated container behind ScaleShield, with daily backups that are restore-tested every night. Start on the free plan, no card needed.

About G7Cloud Engineering

Platform team

Articles written by the engineers who build and run G7Cloud: UK managed hosting and the AI Website Builder. We write about what we operate every day: containers, backups, databases, and the small-business websites that run on them.

More about G7Cloud →