Please let me know in the comments if everything went as expected. I would be happy to revise the snippet if you report otherwise (please provide screenshots). I have tested this code with Storefront theme, the WooCommerce version listed above and a WordPress-friendly hosting.
Check out these free video tutorials. You can learn how to customize WooCommerce without unnecessary plugins, how to properly configure the WooCommerce plugin settings and even how to master WooCommerce troubleshooting in case of a bug!
Business Bloomer Founder
Author, WooCommerce expert and WordCamp speaker, Rodolfo has worked as an independent WooCommerce freelancer since 2011. His goal is to help entrepreneurs and developers overcome their WooCommerce nightmares. Rodolfo loves travelling, chasing tennis & soccer balls and, of course, wood fired oven pizza.
21 thoughts on “WooCommerce: Edit “Continue Shopping” Link Redirect”
It didn’t work for me, I ended up on the home-page for the site and not the main shopping page. Clearly the function changed the default URL, but it seems that wc_get_page_permalink() was nulled, thus being redirected to home-page. But WHY? I did change ‘shop’ to the name of my main shop page.
Thanks for any input on this.
Never mind. Thought I had to change ‘shop’ to the name of my page that is the shop. Used the snippet as-is and it worked just fine.
Thanks Rodolfo, it’s works! Saved me a lot of time and took less than a minute to implement.
When the shopping cart is empty there is another “Return to Shop” button. How can I customize that button to go to another page? I guess it’s a similar solution? Thank you.
Thanks – this totally worked for me just now.
One other thing I’m struggling with is how to edit the “Continue shopping” text. If you have any tips, I’d appreciate it – thanks!
Hey Omar, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!
Hi! I am having trouble with this snippet. When I add it, the continue shopping button does indeed work, however it also messed up something else, I get a “there’s a critical error on your website” message when I click on a product to add it to the cart instead of redirecting me to the cart. Please Help!
Did you use the exact snippet?
Yes, I did. The only thing I changed was wc_get_page_permalink and the ‘shop’ to ‘pricing’. Everything else was the same.
If you want to use an absolute URL:
I have tried to add it to my functions.php but it does not seem to work as expected.
Instead of “Continue Shopping” going to the SHOP page, I need them to go to this page > https://akadeemia.hrsolutions.ee/courses
Not sure if I missed anything in the code, but I just can’t get it to work ….
I’ve tried this …
and I’ve tried this …
Don’t use wc_get_page_permalink(), just return the URL e.g.
Hola! Existe alguna forma que en vez de redirigir a la página de la tienda, se oculte ese enlace?
Hola Pedro, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!
I tried this and it seems to have disabled other links in woocommerce. I removed the code but now the cart page won’t load when adding new items and it won’t let me update the functions.php file (keeps giving me an error that it will not save). Can you help? I was careful not to take out any of the theme code and put it at the bottom right before the ?>. Not sure what happened!
Hello Laura, thanks for your comment! I just tested this again with Storefront theme and it works perfectly. Maybe your theme (or another plugin) is messing/conflicting with my snippet?
To troubleshoot, disable all plugins but WooCommerce and also switch temporarily to “Twentyseventeen” theme (load the snippet there in functions.php) – does it work? If yes, you have a problem with your current theme or one of the plugins.
Hope this helps!
Awesome. It worked!
I was looking for this.