WooCommerce's cart fragments feature updates the mini-cart via an admin-ajax call on nearly every page view, including pages with no cart in sight, and the call bypasses all caching. On busy stores it is routinely the single slowest request on the page. The fix is to stop the fragment call from firing on pages that do not need it.

What causes this?

The wc-ajax=get\_refreshed\_fragments request keeps the cart icon in sync without a reload. It runs on blog posts, landing pages, everywhere, and because it is per-visitor it cannot be page-cached. Each call boots WordPress fully. Multiply by every pageview and it becomes a constant background load.

How to check

Open the Network tab on a non-shop page and look for wc-ajax=get_refreshed_fragments. Time it: 300 ms to well over a second on shared hosting is typical. The audit reports it with its measured cost per page.

How to fix it manually

The mini-cart count stops live-updating on pages where fragments are disabled. Decide whether that matters for your theme.

  1. Choose the scope
Disable everywhere except cart and checkout (common), or only on posts and pages.
  1. Dequeue the script conditionally in functions.php
add\_action('wp\_enqueue\_scripts', function () { if (is\_woocommerce() || is\_cart() || is\_checkout()) return; wp\_dequeue\_script('wc-cart-fragments'); }, 11);
  1. Test
Add to cart from a product, then visit a blog page and confirm nothing errors; the count may simply not refresh until a shop page.
  1. Re-measure the page with the Network tab

How BoltAudit does it

The audit runs all of the above for you and turns it into one reviewed action.

1Finds it automatically with the measured request cost as evidence.

2Preview the exact change. Which pages keep fragments, which drop them.

3Automatic backup, then apply in one click.

4Roll back any time if your theme's header cart needs it everywhere.

Fix this on your site

Common questions

Will customers see wrong cart counts?

On fragment-free pages the count updates on the next shop page view. Most stores accept this; test with your theme.

Is it safe on checkout?

The snippet leaves cart and checkout untouched on purpose.

Why does WooCommerce ship it on?

Live cart sync is a reasonable default for small sites; the cost grows with traffic.

What is the alternative?

Some themes offer their own lightweight cart sync; page caching plus this fix is the usual pairing.

Run BoltAudit on your site

Free plugin · 1 site · 3 audits per month · no credit card.

See plans →