iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
Antihost offers managed WordPress hosting with free migration, one-click staging and a 14-day free trial.
The safe fix is to stop wc-cart-fragments from running on pages that do not need a live mini-cart, while keeping it (or an equivalent cart component) on pages where shoppers expect immediate cart updates. First identify what enqueues the script, then remove accidental global loading, move compatible headers to WooCommerce’s Mini Cart Block, or scope the script with the official filter. Keep cart, checkout, account, session, and cart-cookie behavior dynamic when configuring caches.
WooCommerce changed the default in version 7.8, but themes, plugins, dependencies, and custom headers can still load the legacy script site-wide. The procedure below shows how to find the request, choose the least risky fix, and verify that add-to-cart, quantities, removal, checkout, and cart counts still work.
What the cart-fragments script does
wc-cart-fragments is a browser-side WooCommerce script for the legacy Cart Widget (often displayed as a header mini-cart). It calls the WordPress AJAX API to fetch refreshed mini-cart HTML and cart state without reloading the entire page. The usual request is visible as admin-ajax.php with an action such as get_refreshed_fragments; some implementations expose a WooCommerce AJAX endpoint instead.
The script is useful when a shopper adds or removes an item while staying on a page and the mini-cart must change immediately. It is unnecessary on a page that has no live cart UI. If it runs there anyway, every visitor can create an extra request and the server must initialize enough WordPress and WooCommerce state to answer it. The cost varies with hosting, plugins, theme code, sessions, object caching, and traffic; there is no reliable universal number of milliseconds or server savings.
#1 Best Overall
- Powerful Turbo Fan:CAGIWIRU Electric Air Duster have reached speed up to 130000RPM,Can efficient remove dust and debris.With LED light and Three Adjustable Speed to meet with different cleaning tasks.
- With Attached USB C Fasting Charging cable.Charing 3 hours,Enjoy up to 240 minutes of use on the lowest setting, For third speed can use for 25mins.with four charging options to meet with your needs.
- Wide Application:Upgraded attached 5 different nozzles,making it suitable for a variety of scenes, such as car,pet, pc, keyboards, and other electronic devices. It also serves for office and home clean duster.
- Handy Design & Portable:Cordless air duster electric nozzle is Light weight and small size, design and comfortable to hold and space saving, convenient to carry around. You can put it in your room or inside the car without taking up space.
- Warranty & Support: Our Electric air duster comes with 5 years warranty and 24/7 customer service. During this period, if you have any questions,pls kindly feel free to contact us.
Events that can start a refresh
WooCommerce’s documented triggers include cart events such as wc_fragment_refresh and updated_wc_div, restoring a page from browser history, Customizer handling, and a timeout intended to prevent stale cart displays. The script receives an AJAX URL, a cart-hash key, a fragment name, and a 5000 ms request timeout.
A request can therefore appear even when the shopper has not just clicked “Add to cart.” Browser back/forward restoration or the stale-cart timeout may start it. Seeing one request is not automatically a defect; seeing it on routes with no mini-cart is the usual performance smell.
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Clear out junk files and repair common Windows errorsFree Scan →Why it may load on every page
Older WooCommerce behavior
Before WooCommerce 7.8, cart fragments were globally enqueued by default. A store could consequently make the request on blog posts, landing pages, and other routes that did not display a cart widget.
What changed in WooCommerce 7.8
WooCommerce 7.8, released in 2023, changed the default so the script is normally loaded when the Cart Widget is rendered, when another script declares it as a dependency, or when code explicitly enqueues it. This reduces accidental work on new or correctly configured stores, but it does not override every theme and plugin.
Rank #2
- Screen Cleaner is Your Screen’s New Bestfriend! - EVEO is proud to present a screen cleaner that’s perfectly suited for your TV. Meet your new screen cleaner, computer screen cleaner, laptop cleaner, iPad cleaner, Macbook,tv cleaner or any other electronic device. Our screen cleaner spray and wipe along with the included plush microfiber cloth, easily removes dust, fingerprints & other smudges on the screen’s surface. Clean effectively for a streak-free screen
- Gentle on your Screens - Our screen cleaner spray and wipes is compatible to be used even for the most sensitive LCD, LED, CRT, and OLED screens in proper use. Be at ease knowing that this product is compatible with all the major brands: LG, SONY, Samsung, Sharp, iPad, iPhone, Android screens, Kindle, PC monitors - we’ve got you covered! Can be used as LCD screen cleaner, tv cleaner, smart tv screen cleaner, and more
- Premium Super Soft Plush Microfiber Cloth - Included in this efficient screen cleaning kit. This screen cleaner spray and wipe has our signature plush microfiber cloth specially designed to comply with screens and monitors and leave them streak-free. Has been shown to effectively absorbs stubborn stains, zero streaks, and no fiber shedding. Always use this together with our screen cleaner for the best results
- Easy-to-Use Screen Cleaner Kit + microfiber cleaning cloth - The EVEO Screen Cleaning Kit will easily be your new favorite tool when it comes to taking care of the things you love most, quick and easy solution for a streak-free screen. Simply screw on the sprayer gun on the screen cleaner bottle. Spray the cleaning liquid onto the microfiber cloth, then wipe the screen until desired cleanliness & shine is achieved.
- Quality Screen Care Kit Worth Purchasing - Enjoy a convenient Screen Cleaner anytime, anywhere you need it. Your satisfaction is our top priority. We stand behind the quality of our products and that’s why, you shouldn’t be worrying at all. We manufacture the Best Screen Cleaner. and can be used for laptop cleaning kit, laptop screen cleaner, tv screen cleaner for smart tv. MacBook screen cleaner, monitor cleaner or screen cleaner spray for electronic devices with microfiber cleaning cloth
| Store situation | Expected behavior | What to inspect |
|---|---|---|
| WooCommerce before 7.8 | Cart fragments may be enqueued globally by default. | Upgrade planning, then retest all cart flows. |
| WooCommerce 7.8 or newer with a block-based cart UI | The legacy script is usually absent unless required by another component. | Network requests and script dependencies. |
| WooCommerce 7.8 or newer with a legacy Cart Widget | The script loads where that widget is rendered. | Header, sidebar, footer, and widget areas. |
| Any version with custom code or a plugin dependency | The script can still load on unrelated routes. | Enqueue calls and dependency declarations. |
A theme can hard-code a legacy widget in a header or template, and a plugin can declare wc-cart-fragments as a dependency. In either case, upgrading WooCommerce alone will not remove the request. Treat the actual rendered component and dependency chain as the source of truth.
Diagnose the request before changing code
Do the investigation on a staging copy or while logged out in a private browser window. Record a baseline so you can tell whether a change fixes the cause rather than merely moving the symptom.
Free tools Windows power users keep installed
One-click scans. No signup required.
- Open DevTools and capture a slow route. Load the page with the browser’s Developer Tools open, select the Network panel, enable “Preserve log,” and reload. Filter for
wc-cart-fragments,get_refreshed_fragments,admin-ajax.php, andwc-ajax. Record the request URL, initiator, status, duration, and response size. - Check whether the page needs a live mini-cart. Inspect the header, sidebar, footer, and page markup for a legacy Cart Widget or a custom mini-cart. A page can have no visible widget while a theme still renders one off-screen or loads code for it.
- Follow the initiator and dependencies. In the Network panel, open the request’s “Initiator” information and inspect loaded scripts. Search the active theme and plugins for
wp_enqueue_script( 'wc-cart-fragments' ), for the handle in dependency arrays, and for custom code that listens for fragment events. - Compare two routes. Test one page that genuinely needs immediate cart updates and one page that does not. If both issue the request, the enqueue or dependency is broader than necessary. If only the widget page does, that may be correct legacy behavior.
- Repeat with the widget or dependency removed on staging. Temporarily disable the suspected component, clear relevant caches, and reload both routes. The request should disappear from pages that no longer contain cart behavior while remaining on pages that still require the legacy mini-cart.
- Exercise real shopper actions. On staging, test add-to-cart from a product and an archive page, quantity changes, remove-item, cart count updates, browser back/forward, cart, checkout, and account pages. Include guest and logged-in sessions if your store supports both.
Do not infer that a slow admin-ajax.php request is caused only by fragments. The endpoint may also be handling unrelated AJAX actions, and plugins can add substantial work during every request. Use the request’s action, initiator, server logs, and a staging comparison to establish causation.
Choose the least risky fix
Use this decision framework before editing production code.
Rank #3
- 【Large size】:Measuring 800 x 300 mm/ 31. 5×12 inches, which is wider and taller than others. Large mouse pad can perfectly fit your keyboard and mouse of any size, and there is also ample space for peripherals such as phones, tablets, etc.
- 【LED backlight mouse pad】:Blade Hawks RGB mouse pad provides 7 static modes and 7 dynamic modes will give you the options you are looking for. Power-off memory function remembers the last lighting mode you selected. The super glow fiber Chroma will give you a colorful gaming setup that you want.
- 【Anti-slip rubber base】:Made from Natural rubber, this gaming mousepad will firmly grip your desktop, allowing you to enjoy the ultimate precision in the games you are most passionate about. It also comes with a texture that enhances this ability even further.
- 【Smooth and waterproof surface】: Micro-textured cloth surface, for extremely precise mouse control and a smooth movement. When liquid splashes on the gaming mouse pad, it forms water droplets and slides down. Will not delay your work or gameplay.
- 【Plug and play】: This mouse and keyboard pad is powered by USB, plug and play, no driver required. One button control light modes. Press one time to change the lighting mode, press twice to change the brightness, press and hold about 3 seconds turn ON/OFF.
| Situation | Preferred approach | Main trade-off |
|---|---|---|
| No live mini-cart on a route | Remove the accidental global enqueue or scope execution away from that route. | Custom cart UI on that route will no longer update unless explicitly supported. |
| Header or sidebar uses the legacy Cart Widget | Keep fragments where the widget is needed, or migrate to the Mini Cart Block if the theme and plugins support it. | Migration can require theme styling and interaction testing. |
| Custom code depends on fragment events | Keep the script available and document the dependency; scope only routes that cannot use that code. | Removing it can break custom count updates or replacement markup. |
| Requests are correct but slow | Profile server-side AJAX work and correct cache/session rules in addition to JavaScript changes. | Caching dynamic commerce state incorrectly can create a checkout or privacy defect. |
Fix 1: remove accidental global loading
This is the cleanest fix when no component needs a live legacy mini-cart on the affected routes.
Find the owner
- Check the active theme’s enqueue functions and child-theme overrides.
- Search plugins and custom snippets for the exact handle
wc-cart-fragments. - Inspect dependency arrays: another script may load fragments indirectly even when no code calls the handle by itself.
- Look for a legacy Cart Widget rendered in a global header, sidebar, footer, or template part.
Remove or narrow the enqueue
Delete the global enqueue only after confirming that no live widget or custom listener needs it. Replace it with a conditional enqueue tied to the routes where the legacy mini-cart is rendered, or remove the legacy widget entirely if the site has moved to another cart component. Do not hide the request with a front-end optimization setting while leaving a required widget without its update mechanism.
Recommended Free Tools
Verify the change
Clear page, object, and browser caches, then repeat the DevTools comparison. The script should be absent from unrelated pages and present on the route that still renders the legacy widget. Run every cart action on staging before deploying.
Fix 2: use the Mini Cart Block when compatible
WooCommerce’s 7.8 release guidance recommends the Mini Cart Block as an alternative to the legacy widget. A block-based mini-cart can avoid the specific legacy cart-fragments loading pattern, but compatibility depends on the active theme, block support, checkout setup, and plugins that modify cart markup.
Rank #4
- 【Softer and More Comfortable】Vaydeer wrist rest has unique diamond pattern, which is the combination of softness and aesthetics. The materials of wrist rest are improved into higher quality memory foam and covered with silky smooth lycra. The computer wrist rest makes you as comfortable and cushiony as like rest your wrists on clouds.
- 【Ergonomic Wrist Saver】The wrist rests for keyboard and mouse comes with a 17.32×3.15×0.83 inch keyboard wrist pad and a 5.94×3.15×0.83 inch mouse wrist support. Based on ergonomic design, the unique concave shape is the perfect fit for your wrist joints. The wrist rest pad fits most computer keyboards and laptops, improve hand and wrist posture, release your wrist and arm stress.
- 【Non-Slip Rubber Bottom】Featuring an anti-skid silicone base on the bottom, this wrist keyboard support stays firmly in place on your desk, preventing the padding from sliding around, ensuring stable and consistent wrist support during extended computer sessions.
- 【Better Experience & Pain Relief】Our keyboard arm rest is beneficial to alleviate the soreness caused by direct contact and friction between your arm and a hard desk surface, reducing the risk of wrist fatigue or carpal tunnel. The soft texture of memory foam can evenly distribute the pressure around your wrists and provide good support with just enough give.
- 【Helpful in Multiple Scenarios】Whether you're working, studying, writing, typing, gaming, this keyboard and mouse rest combo is an essential accessory to add comfort and support to your hands and wrists. It’s also a great gift for men, women, family, friend, coworker, gamer, teacher, etc.
Migration checklist
- Duplicate the current header or template in staging so you can restore it quickly.
- Confirm that the theme supports editing the relevant header or template part with blocks.
- Replace the legacy Cart Widget with the Mini Cart Block in the staging header or sidebar.
- Check logged-out and logged-in views, empty and populated carts, product and archive add-to-cart buttons, quantity controls, remove actions, and the link to the full cart.
- Test responsive layouts, keyboard navigation, screen-reader labels, and any currency, tax, membership, or product-add-on extensions that alter cart content.
- Compare Network requests and server timings with the old widget before publishing the change.
If a plugin or custom script listens specifically for legacy fragment events, update that integration or keep the legacy component on the routes where it is still required. Do not assume that visual similarity means behavioral compatibility.
Fix 3: scope execution with the official filter
When the script must remain registered or available but should not execute on unrelated routes, WooCommerce documents the woocommerce_get_script_data filter. The following pattern returns normal data on WooCommerce, Cart, and Checkout pages and returns null elsewhere:
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallCrashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minute<?php
add_filter( 'woocommerce_get_script_data', function( $script_data, $handle ) {
if ( 'wc-cart-fragments' === $handle ) {
if ( is_woocommerce() || is_cart() || is_checkout() ) {
return $script_data;
}
return null;
}
return $script_data;
}, 10, 2 );
What the filter changes
On permitted pages, the script receives its usual data and can run. On other pages, returning null prevents the fragment data from being supplied, so the script does not execute its refresh logic there. This is different from deregistering the asset globally: code can still load the handle where a permitted component needs it.
Adapt the condition to your site
The sample condition is intentionally conservative, not universal. Add custom landing pages, product-builder routes, or other URLs when they contain a live cart UI or code that depends on fragment updates. Conversely, do not include an entire site section merely because it links to the cart. The relevant question is whether the current page must update cart state without a full navigation.
Best Value
- 【No Drill Mounted】Cable management tray can be assembled in as little as 3 minutes or less-simply. Side clips easily clampe the edge of desk, pass through the holes on the sides, and secure excess cables with baskets. Desk cable management supports inward or outward installation to meet your needs in different scenarios, and provides you with great convenience when collecting and organizing wires.
- 【Rubber Pad Protects Desk】Wire organizer under desk built-in soft rubber pads on the clamp protect your desk from scratches, so you will not damage your furniture or office.
- 【Sturdy and Beautiful】Cord management under desk is made of high-quality carbon steel and holds about 15 lbs. The wire basket has 2 holes on each side of the tray to enable your cables to pass freely. Cable baskets are suitable for desk thickness use from 0.4" to 2.4".
- 【Space Saving & Keep Organized】Desk cable management tray holds all your power cords, outlet strips, USB hubs and computer transformers hidden from your feet, and the data cables will not enter the vacuum cleaner to keep your desk clean and tidy. Desk wire organizer is also suitable for use in the kitchen and outdoors.
- 【Reduce Safety Risks】Cable tray under desk keeps all plugs away from your kids, no more worry about tripping. Using 2 holes wire tray saves extra space, helps you easily cabling and wire protection. The mesh design is not easy to accumulate dust, but avoids safety accidents caused by messy wires.
Apply the filter in a maintainable site-specific plugin or child-theme code location, not a temporary admin snippet that may be lost during a theme change. After adding it, test every custom route that displays a cart count or mini-cart. WooCommerce’s caveat is important: non-standard pages can stop updating if they are excluded even though they contain cart behavior.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Fix 4: keep fragments deliberately when a legacy cart is required
Some stores still need the legacy widget because of theme markup, extension compatibility, or custom JavaScript that consumes fragment events. In that case, do not disable the script merely because a performance audit flags it. WooCommerce documents manual enqueueing for stores that provide equivalent functionality or otherwise need the script.
Document which templates require the handle, which events custom code listens for, and which routes are intentionally excluded. This prevents a future optimization pass from removing a dependency without realizing that the header count, remove buttons, or promotional cart messages rely on it.
Correct caching and session rules
JavaScript changes cannot make a shared cache safe for personalized cart state. Keep the Cart, Checkout, and My Account pages dynamic. Exclude WooCommerce session data and cart-related cookies from shared page caching, and ensure that a cached anonymous response cannot be reused for a shopper with a different cart.
Cache review checklist
- Verify that Cart, Checkout, and My Account responses are not stored as publicly shared HTML.
- Exclude WooCommerce session identifiers and cart-fragment or cart-hash cookies according to the cache layer’s documented cookie matching rules.
- Check page cache, reverse proxy, CDN, object cache, and host-level cache separately; disabling one layer does not disable the others.
- Purge existing cached HTML after changing exclusions.
- Test two separate browser sessions with different carts to ensure one shopper never sees another shopper’s cart count or items.
A cache leak is a correctness and privacy failure, not merely a performance issue. If a cache layer cannot vary or bypass requests safely, favor an explicit bypass for dynamic commerce pages over an aggressive but ambiguous rule.
Validate performance and correctness after deployment
Deploy first to staging, then repeat the same measurements on production during representative traffic. Use the browser Network panel for client-visible behavior and server logs or application monitoring for backend cost.
Record these measurements
- Whether a fragment request occurs on each route category.
- Request duration, status code, response size, and initiator.
- Number of fragment or cart AJAX requests during a normal browse-and-add session.
- Server response time for the specific AJAX action, separate from unrelated
admin-ajax.phpactions. - Cart and checkout error logs, JavaScript console errors, and failed nonce or session responses.
Run a functional matrix
| Scenario | Expected result |
|---|---|
| Product-page add to cart | Item is added, cart count and any required mini-cart update correctly. |
| Archive or search-result add to cart | Same result without a stale header count. |
| Remove item and change quantity | Displayed totals and item count match the server cart. |
| Empty cart | Empty-state message and cart link remain usable. |
| Browser back/forward | No stale or contradictory cart state appears. |
| Cart and checkout | Pages remain dynamic and payment, shipping, coupons, and order placement are unaffected. |
| Two browser sessions | Each session sees only its own cart. |
There is no official universal benchmark for milliseconds saved, server-cost reduction, or conversion lift from disabling cart fragments. Report the change using your store’s before-and-after request counts, durations, and error rates rather than a guaranteed percentage.
Quick Recap
Troubleshoot common outcomes
| Symptom | Likely cause | Action |
|---|---|---|
| The request remains on every page after upgrading to 7.8 or newer. | A theme widget, plugin dependency, or explicit enqueue still loads it. | Use the Network initiator and code search to identify and narrow that component. |
| The mini-cart no longer updates on a custom landing page. | The route was excluded by the filter but contains live cart behavior. | Add the route to the allowed condition or restore the required component. |
| Add-to-cart works but the header count is stale. | Custom JavaScript expected a fragment event or the replacement UI has no equivalent update. | Restore the dependency or update the integration for the chosen cart component. |
admin-ajax.php is still slow after fragments are scoped. |
Another AJAX action or expensive plugin code is responsible. | Inspect the action name, initiator, server trace, and plugin hooks instead of re-enabling fragments globally. |
| One shopper sees another shopper’s cart. | Shared caching is storing personalized HTML or session responses. | Bypass dynamic pages and exclude session/cart cookies at every cache layer, then purge cached content. |
| Checkout or payment behavior changes after the edit. | Cart, checkout, session, or extension scripts were excluded too broadly. | Roll back on staging, narrow the condition, and retest the full checkout matrix. |
Recommended order of operations
- Capture a baseline request and functional test on staging.
- Identify the widget, enqueue, or dependency that causes the script to load.
- Remove global loading where no live mini-cart exists.
- Consider the Mini Cart Block if the theme and extensions support it.
- Use the official data filter for precise route scoping, including every custom cart route.
- Review page-cache and cookie exclusions before production deployment.
- Re-test cart, account, checkout, guest, logged-in, and multi-session scenarios.
- Monitor request counts, durations, and errors after release.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

