Black Friday 40% off yearly and lifetime plans · 18d left Ends in 18d09h24m Claim 40% off
WooCommerce50 docs

How to Redirect Visitors From an Empty Cart in WooCommerce

Redirect customers away from an empty WooCommerce cart to the shop page or a custom page you choose. Avoid a dead end and keep them shopping in your store.

By Founder & Lead Developer

Last updated

2 minutes

Key takeaways

  • Redirect visitors when they open an empty cart
  • Send them to the shop page or a custom URL
  • Control the destination from the settings
  • Keeps customers moving instead of showing an empty cart
  • Uses WooCommerce’s template redirect hook

What Does the Feature Do?

When the cart is empty, the WooCommerce cart page shows a message and offers little to do. The Redirect Empty Cart feature sends the visitor to a useful destination instead of showing the empty cart page.

The destination is configurable: visitors can go to the shop page or a custom URL you provide.

Why You Need It

An empty cart is a dead end for a visitor:

  • They cannot add anything from inside the cart page
  • The empty message gives no path forward
  • Redirecting keeps them moving toward your products or a specific page
  • A custom URL lets you control the exact landing page

How to Redirect an Empty Cart in WooCommerce

  1. Step 1

    Enable the Feature

    1. In WordPress admin, open Classic Monks > WooCommerce.
    2. Open the Redirection settings area.
    3. Toggle on Redirect if Cart is Empty.

    WooCommerce redirection settings.

  2. Step 2

    Choose the Destination

    • Redirect Page: pick the shop page, a specific site page, or Custom.
    • If you choose Custom, enter a Custom URL to send visitors to.

    Select shop page redirect destination

  3. Step 3

    Save and Test

    Click Save Changes. Open the cart page with an empty cart and confirm you are redirected to the destination you chose. When the cart has items, the cart page shows normally.

Configuration Options

Option Behavior Default
Redirect if Cart is Empty Master toggle. Off
Redirect Page Shop, a selected page, or Custom. Shop
Custom URL Destination when Redirect Page is set to Custom. Blank

What Gets Affected

  • The cart page when the cart is empty: visitors are redirected
  • The destination page: receives the redirected visitor

What Does NOT Get Affected

  • The cart page when the cart has items: shows normally
  • The selected destination page’s own content: unchanged
  • Saved carts and customer data: unaffected

Advanced Options (Developers)

The feature registers one hook in functions/woocommerce/woocommerce-functions.php:

add_action( 'template_redirect', 'cm_redirect_empty_cart' );

template_redirect calls cm_redirect_empty_cart() to check the cart state on the cart page and redirect empty carts to the configured destination.

Common Use Cases

Keep visitors shopping. Send empty-cart visitors back to the shop so they continue browsing.

Direct to a sale landing page. Use a custom URL to route empty-cart traffic to a specific promotion or collection.

Mobile experience. On phones, a redirect to a browsable page is more useful than an empty cart message.

Frequently asked questions

When does the redirect happen?

It happens when a visitor opens the cart page while the cart is empty. With items in the cart, the page renders normally.

Where do visitors go?

To the destination you choose: the shop page, a specific page, or a custom URL.

Does it clear or change the cart?

No. The cart data is untouched. The feature only redirects the visitor away from the empty cart display.

Can I use a custom URL?

Yes. Set Redirect Page to Custom and enter the Custom URL.

Troubleshooting

3 problems and how to fix each one.

The redirect is not happening

Cause: The toggle is off, or the cart is not actually empty.
Fix: Confirm the toggle is on and that the cart has no items. Clear the cart and test again.

It redirects to the wrong page

Cause: The destination setting points somewhere unexpected.
Fix: Review Redirect Page and, if Custom, the Custom URL. Save and test again.

A page I want is not in the list

Cause: Not every page may appear in the selector.
Fix: Use the Custom destination with a Custom URL to direct visitors to any page.

Was this doc helpful?

Your answer tells us which docs to fix first.

Still stuck? Ask on the forum or email help@classicmonks.com.
Joy Chetry
Written by the person who built it

Joy Chetry

Founder & Lead Developer, Classic Monks

Joy is the founder of Classic Monks and GoodMonks Solutions, a web development agency that builds WordPress and WooCommerce sites for clients. Classic Monks grew out of the agency's own need to consolidate 20 to 30 separate plugins into one core stack.

Follow this doc on a real site.

Open a private WordPress site with Classic Monks, WooCommerce and Bricks Builder installed, and follow this doc step by step. Free for 24 hours, no card.

280 docs, written by Joy Chetry 15 day refund window