WooCommerce ships with a setting that redirects shoppers to the cart page immediately after they click the Add to Cart button on any product. The idea behind this default is to push customers toward checkout as quickly as possible, reducing the number of steps between product discovery and purchase. In practice, however, many store owners find the opposite effect: customers who are browsing a product catalog and adding multiple items to their cart get interrupted after every single click, losing their place in the catalog and having to navigate back to keep shopping. It is a particularly frustrating experience on stores that sell complementary products — a photography supply shop, for example, where a customer routinely adds a camera, a lens, a memory card, and a bag in the same session. Each redirect breaks the browsing flow and adds unnecessary friction. The WooCommerce settings panel offers a simple toggle under WooCommerce → Settings → Products → General where you can enable “Redirect to the cart page after successful addition.” Unchecking this box stops the redirect, but the same result can be achieved programmatically via a filter hook, which is more portable across environments and deployments than a settings checkbox that might get accidentally re-enabled. The filter woocommerce_add_to_cart_redirect fires after an Add to Cart action and receives the redirect URL as its argument. Returning false from this filter cancels the redirect entirely and keeps the customer on the current page. This approach also works reliably with AJAX-powered add-to-cart buttons, where the redirect happens client-side rather than through a PHP header. When combined with a well-designed cart widget in your theme’s header, this pattern gives customers a seamless multi-product shopping experience without page reloads between additions. The snippet is two lines and has no side effects on the rest of the checkout flow.
Problem: WooCommerce redirects customers to the cart page after every product addition, interrupting multi-product browsing sessions.
Solution: Add the following code to your functions.php file:
<?php
add_filter( 'woocommerce_add_to_cart_redirect', '__return_false' );
NOTE: This filter disables the server-side redirect. WooCommerce also supports AJAX add-to-cart, which handles the redirect on the client side via JavaScript. To disable the AJAX redirect as well, go to WooCommerce → Settings → Products → General and uncheck “Redirect to the cart page after successful addition.” Both mechanisms need to be addressed for a complete fix. After applying the snippet, test on both simple and variable products to confirm the behavior on your specific theme.