Skip to main content
Login Join
Snippet · PHP

Redirect to Checkout After Add to Cart

Shared by Kamran Abdul Aziz · May 13, 2026 · @woocommerce_add_to_cart_redirect

22 views
Back to Snippets

Skips the cart page entirely and redirects customers straight to the checkout page as soon as a product is added to cart. Ideal for single-product stores or focused sales funnels where the cart step adds unnecessary friction and reduces conversions. Uses the woocommerce_add_to_cart_redirect filter to override the default redirect URL.

add_filter( 'woocommerce_add_to_cart_redirect', 'redirect_to_checkout_after_add_to_cart' );

function redirect_to_checkout_after_add_to_cart( $url ) {
    return wc_get_checkout_url();
}
Know a different way to do this? Add your approach as a variation so folks can compare them side by side.
Submit a variation

0 comments