Remove Product From Cart Programmatically WooCommerce To remove a product from the cart programmatically in WooCommerce, use the woocommerce_cart_item_removed and woocommerce_before_calculate_totals hooks.