WooCommerce can slow down a WordPress site, but the problem is rarely WooCommerce by itself.
The real issue is usually how the store is built, what scripts load on non-store pages, how the cart behaves, how images are handled, how caching is configured, and whether anyone tests the full buying flow after making performance changes.
This article was first published in 2019, when cart fragments were a common source of slow page loads across WooCommerce sites.
That problem still matters, but the advice needs a 2026 update. WooCommerce has changed. Blocks are more common. Cart and checkout flows are more sensitive. A broad dequeue snippet in a theme file can create bugs that are harder to find than the original performance issue.
The goal is not to remove every WooCommerce asset. The goal is to load what the store needs, where it needs it, and protect the path from product discovery to checkout.
Start With Measurement, Not Guesswork.
Before changing code, measure the site.
Use a browser network panel, Lighthouse, PageSpeed Insights, WebPageTest, GTmetrix, server logs, or a performance monitoring tool to identify the real bottleneck.
Look for slow server response, large images, render-blocking CSS, excessive JavaScript, layout shift, uncached pages, slow AJAX requests, third-party scripts, and plugin assets loading where they are not needed.
For WooCommerce, test more than the homepage. Test the shop page, product pages, category pages, cart, checkout, my account, and normal blog or content pages.
A store can score well on a homepage and still lose customers because the product or checkout path feels slow.
Understand Cart Fragments Before Disabling Them.
Cart fragments are the WooCommerce behavior that keeps cart widgets and cart counts updated without a full page refresh.
In older WooCommerce setups, cart fragments could load across large parts of the site and trigger requests to refresh cart state. On slow hosting or plugin-heavy sites, that could add noticeable overhead.
WooCommerce’s developer advisory on the cart fragments API explains that WooCommerce 7.8 changed the default behavior so the cart fragments script is no longer enqueued on all page routes by default.
That matters because old advice is not always safe anymore.
If a modern store still has cart fragments loading everywhere, a theme, plugin, mini-cart widget, custom header, or legacy integration may be forcing it back in.
Do Not Remove WooCommerce Scripts Blindly.
The old version of this post included a large snippet that dequeued many WooCommerce scripts and styles on non-WooCommerce pages.
That kind of broad removal can be risky in 2026.
WooCommerce scripts may support product galleries, variations, add-to-cart behavior, cart notices, checkout validation, payment sections, account pages, blocks, and integrations from other extensions.
Removing those assets without understanding the site can break variable products, cart updates, checkout fields, payment methods, mini-cart behavior, tracking events, or accessibility states.
A better approach is conditional loading based on the site’s actual templates and features.
Use Conditional Loading With Clear Boundaries.
If WooCommerce assets are loading on normal blog posts or marketing pages that do not include products, carts, checkout blocks, mini-carts, or product widgets, conditional loading may help.
However, the condition should be conservative.
Keep WooCommerce assets on shop pages, product archives, single product pages, cart, checkout, account pages, order received pages, pages with product blocks, and any page that includes a cart or mini-cart.
Remove or delay only the assets that are proven unnecessary on specific non-store pages.
This is a performance decision, not a cleanup reflex.
Prefer WooCommerce-Aware Fixes.
Modern WooCommerce performance work should respect how the plugin expects the store to work.
That usually means checking theme support, reviewing mini-cart usage, testing whether cart fragments still execute, reviewing block-based cart and checkout pages, and confirming whether an optimization plugin already handles script loading.
WooCommerce’s Cart and Checkout Blocks architecture notes explain that the blocks use the Store API for cart and checkout data. That is a different model from older shortcode-only cart and checkout assumptions.
If a site uses block cart or checkout, test those flows directly before disabling or delaying anything that touches WooCommerce JavaScript.
The store must remain fast and functional.
Fix the Bigger Performance Problems Too.
Cart fragments may be visible in performance reports, but they are rarely the only issue.
Many WooCommerce stores are slow because product images are oversized, the theme loads too much CSS, plugins add scripts on every page, hosting response time is high, database tables need maintenance, object caching is missing, or checkout depends on too many third-party scripts.
A useful performance pass should look at the whole store.
Resize product images. Use modern formats where the hosting pipeline supports them. Limit plugin overlap. Keep product grids efficient. Avoid heavy page builders on product templates when simpler templates will work. Cache public pages carefully while excluding cart, checkout, account, and other personalized flows.
Performance improves when the store does less unnecessary work.
Protect Cart, Checkout, and Account Pages.
WooCommerce performance work has one hard rule: do not break the money path.
Cart, checkout, account, and order received pages often need special caching exclusions, scripts, cookies, payment provider assets, and validation behavior.
Do not aggressively cache checkout. Do not delay payment scripts without testing. Do not dequeue checkout scripts because they look heavy. Do not disable WooCommerce notices or validation states just to reduce JavaScript.
Instead, test the full flow: add to cart, update quantity, apply coupon, calculate shipping, enter checkout fields, complete a test order, review account pages, and confirm order emails.
A fast broken checkout is worse than a slower working one.
Use a Safer Cart Fragments Decision Tree.
A practical 2026 review should follow a simple path.
First, check whether cart fragments actually load and execute on pages where they are not needed. Second, identify what causes them to load: the theme, a mini-cart widget, a plugin, or custom code. Third, decide whether that feature is needed on those pages. Fourth, remove the feature or conditionally load it with a small, tested change.
If the header mini-cart is the reason, consider replacing it with a normal cart link on content pages or using a block-based cart approach where appropriate.
If a plugin forces WooCommerce scripts globally, review the plugin settings or replace the plugin before adding fragile code.
The best fix is the one that removes unnecessary work without surprising the customer.
Test Performance Like a Store Owner.
Performance scores are useful, but stores make money through workflows.
Test the site as a customer would use it. Start on a content page. Move to a category. Open a product. Add it to the cart. Update the cart. Start checkout. Complete the order in a test environment.
Watch network requests, console errors, layout shifts, and user-facing delays.
Also test mobile. A store that feels fine on desktop can feel heavy on a throttled mobile connection.
The final question is not whether one script disappeared. The question is whether the store feels faster while still behaving correctly.
The 2026 View: WooCommerce Performance Is Operational Design.
WooCommerce performance is not a one-line snippet.
It is a design and operations problem.
The store needs the right theme support, clean templates, controlled plugins, optimized images, careful caching, reliable checkout behavior, and performance checks that match how customers actually buy.
For content-heavy sites with a store attached, the goal is especially clear: normal pages should stay lean, while commerce pages should keep the assets they need to sell safely.
Eckman Design builds WordPress and WooCommerce systems with performance, privacy, maintainability, and real operating workflows in mind.
Hello, can you tell me how to check that the code is active after I put it in functions.php ?
Thank you.
The easiest way is to use GTMetrix to see if you still have the wc-ajax=get_refreshed_fragments in the waterfall tab. You can also use the developer tools in Chrome (https://developers.google.com/web/tools/chrome-devtools/network/reference), or your other favorite browser.
So is your code different from original plugin?
https://github.com/littlebizzy/disable-cart-fragments
Yes, it is, it deque’s the script far later which fixes most of the issues of other plugins and themes enqueuing the script after the plugin is loaded. It also gives you the control of which page types you want to keep it from loading on. This is important because not loading this script can break parts of your site that depend on the cart fragment. But if it’s the homepage of your business site or a blog post, you’ll almost never need to load all of Woocommerce or the cart fragments. The above code fixes that.
hi.
on gtmetrix i can t see “cart” but i see only this “POST ?wc-ajax=get_refreshed_fragments”. wich one is the code?