Stopping Cart Fragments From Updating in WooCommerce

Not too long ago, I had a request through my contact form, regarding additional admin-ajax.php requests that currently are not covered by Heartbeat Control (since Heartbeat Control is meant to stop heartbeat requests, not AJAX requests). The requests he was referring to were caused by his cart fragments being updated and wanted them to stop.

Note: This will stop your cart items from being updated live on the page when adding an item to the cart. The items will be added successfully, but won’t update until the next page load.

add_action( 'wp_print_scripts', 'nuke_cart_fragments', 100 );

function nuke_cart_fragments() {
    wp_dequeue_script( 'wc-cart-fragments' );

    return true;

Once again, notice that the entire script is de-queued. See the above note for the consequences of doing this.


    1. It shouldn’t, as all it does is prevent an action from firing. In fact, if it broke anything at all, you could just remove the lines that were added.

      What errors did you get?

Leave a Reply to Jesse Cancel reply