US Trends

how to change return to shop link in woocommerce

To change the “Return to shop” link in WooCommerce, you’ll normally add a small PHP snippet that tells WooCommerce where to send users when the cart is empty. Below is a blog-style, SEO‑friendly “Quick Scoop” you can use, including steps, code, and some storytelling.

How to Change Return to Shop Link in WooCommerce

If your WooCommerce “Return to shop” button is sending customers to the wrong place, you can easily redirect it to any page you want—your homepage, a custom landing page, or even a special offers page.

What the “Return to shop” Button Actually Does

On an empty cart page, WooCommerce shows a “Return to shop” button that, by default, links to your main Shop page.

  • It appears when the cart has no products.
  • It uses a filter called woocommerce_return_to_shop_redirect to decide the URL.
  • You can hook into that filter with a simple function in your theme or a code snippets plugin.

Think of it as a small “escape door” from an empty cart—you’re just changing where that door opens.

Quick Method: Send Users to Any Custom URL

This is the most common use case: you want the button to send users somewhere specific (like your homepage, a category, or a landing page).

Step‑by‑step (theme functions.php)

  1. Go to Appearance → Theme File Editor in your WordPress dashboard.
  1. On the right, click functions.php of your (child) theme.
  1. Scroll to the bottom and paste a snippet like this:
php

// Change the URL of the "Return to shop" button
add_filter( 'woocommerce_return_to_shop_redirect', 'my_custom_return_to_shop_url' );

function my_custom_return_to_shop_url() {
    // Example: send users to homepage
    return home_url(); 
    
    // OR: send to a specific custom page
    // return 'https://yourwebsite.com/your-custom-page';
}
  1. Click Update File.
  2. Visit your site, empty the cart, and click “Return to shop” to confirm it goes to the new URL.

This approach is shown in multiple guides and tutorials and works with recent WooCommerce versions.

Option: Send to Checkout or a WooCommerce Page

Sometimes you want customers to go directly to checkout or to a specific WooCommerce page after seeing an empty cart.

You can reuse the same filter but change the return value:

php

add_filter( 'woocommerce_return_to_shop_redirect', 'my_custom_return_to_shop_to_checkout' );

function my_custom_return_to_shop_to_checkout() {
    // Send users to the checkout page
    return wc_get_checkout_url();
}

Or send them back to the WooCommerce shop page explicitly:

php

add_filter( 'woocommerce_return_to_shop_redirect', 'my_custom_return_to_shop_to_shop_page' );

function my_custom_return_to_shop_to_shop_page() {
    // Return the Shop page permalink
    return get_permalink( wc_get_page_id( 'shop' ) );
}

This is handy if your “shop” experience lives in a special page or layout.

Bonus: Change the “Return to shop” Button Text

If you’re already customizing the link, you may want to change the button label too—for example to “Continue browsing” or “Back to products”.

You can adjust the text with either the dedicated WooCommerce filter or a more general translation filter.

Using WooCommerce’s own text filter

Some guides show this cleaner approach:

php

// Change the text of the "Return to shop" button
add_filter( 'woocommerce_return_to_shop_text', 'my_custom_return_to_shop_text' );

function my_custom_return_to_shop_text( $text ) {
    return 'Continue browsing'; // Your custom text
}

Using gettext (works broadly)

Or you can intercept the string with gettext:

php

add_filter( 'gettext', 'my_change_return_to_shop_text', 20, 3 );

function my_change_return_to_shop_text( $translated_text, $text, $domain ) {
    if ( 'woocommerce' === $domain && 'Return to shop' === $text ) {
        $translated_text = 'Go back to the products';
    }
    return $translated_text;
}

Both methods let you rephrase the button to better match your brand voice.

Where to Put the Code (Safely)

You have a few options for where this code lives:

  • Child theme’s functions.php :
    • Recommended if you’re comfortable editing theme files.
    • Changes survive parent theme updates, but not child theme changes.
  • Code snippet plugin (like a “Custom Functions” or “Code Snippets” plugin):
    • Safer for non‑developers.
    • Easy to enable/disable and doesn’t touch theme files (noted as a common best practice in tutorials).

Whichever you choose, always test on a staging site or during low‑traffic hours.

Example Use Cases (Story Style)

  • A fashion store redirects “Return to shop” to a curated “New Arrivals” page to push fresh items first.
  • A digital product site sends users directly to a “Browse all downloads” page instead of a generic shop, keeping the funnel tighter.
  • A brand with a heavy homepage experience (hero banners, promos, categories) sends users to the homepage to showcase all entry points.

Each of these just changes the URL returned by your filter function.

Small Troubleshooting Checklist

If your new link doesn’t seem to work:

  • Make sure there are no PHP errors (a missing ; or bracket can break the site).
  • Check that the snippet only appears once and not duplicated with different URLs.
  • Confirm there isn’t another snippet or plugin also using woocommerce_return_to_shop_redirect and overriding yours.
  • Clear any caching (plugin, server, CDN) and test again.

Mini HTML Table: Common Targets for “Return to shop”

[7][9] [3] [3] [9][7][3]
Destination Return value in function
Homepage return home_url();
Checkout page return wc_get_checkout_url();
Shop page return get_permalink( wc_get_page_id( 'shop' ) );
Custom landing page return 'https://yourwebsite.com/your-custom-page';

SEO Bits for Your Post

If you’re turning this into a blog article targeting “how to change return to shop link in WooCommerce” :

  • Use that key phrase in:
    • The H1 title.
    • At least one H2.
    • The first 100–150 words.
  • Add related terms like “WooCommerce return to shop redirect” , “change return to shop URL” , and “empty cart button link” in natural language.
  • Include a short meta description such as:
    “Learn how to change the WooCommerce ‘Return to shop’ link and text using simple code snippets. Redirect users to your homepage, checkout, or any custom page in minutes.”

Bottom note:
Information gathered from public forums or data available on the internet and portrayed here.