We’ve already seen how to remove the product permalink from the “order table” (the one you see on the Thank you page, My account pages and emails). Thsi time, we’re looking at doing the same thing on the Cart page, which uses different “hooks” than the order pages and therefore requires its own snippet.
Here’s how it’s done – as usual 1 PHP line is sufficient!
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.
If you think this code saved you time & money, feel free to join 17,000+ WooCommerce Weekly subscribers for blog post updates and 250+ Business Bloomer supporters for 365 days of WooCommerce benefits. Thank you in advance!
Need Help with WooCommerce?
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!
Rodolfo Melogli
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.
When I do this it does indeed remove the link but it also makes the text white, even though I have links set to a blue color. I can’t find a workaround for this, please help!
Hi! This does not work for me – maybe because I we are using built-in attributes. After adding this add_filter to functions.php the product links are still there in the cart, example: /shop/traffic-signs/advisory-speed/?attribute_pa_size=45x45cm&attribute_pa_sub=steel-16-guage&attribute_pa_reflct=engineer
I’m actually trying to eliminate the additional variables (starting at ?) and keep the product URL, example: /shop/traffic-signs/advisory-speed/
Hi, how can we do that only for some products? forexample on my case I am trying to hide wp job manager listing type product from market(shop) and want to users if purchase some listing type its add to cart a product and this product coming to viewable. I just dont want that products viewable. there is a way to configurate this product id?
Questions? Feedback? Support? Leave your Comment Now! _____
If you are writing code, please wrap it between shortcodes: [php]code_here[/php]. Failure to complying with this (as well as going off topic, not writing in English, etc.) will result in comment deletion. You should expect a reply in about 2 weeks - this is a popular blog but I need to get paid work done first. Please consider joining BloomerArmada to get blog comment reply priority, ask me 1-to-1 WooCommerce questions and enjoy many more perks. Thank you :)
With 100,000 (and growing) monthly organic sessions, Business Bloomer is the most consistent, most active and most complete WooCommerce development/customization blog.
Of course this website itself uses the WooCommerce plugin, the Storefront theme and runs on a WooCommerce-friendly hosting.
When I do this it does indeed remove the link but it also makes the text white, even though I have links set to a blue color. I can’t find a workaround for this, please help!
Sounds like a CSS issue to me
Thanks for posting. Still works in august 2022.
Great!
Remove Product Title Permalink for Email Notifications. How do i do that?
https://www.businessbloomer.com/woocommerce-remove-permalink-product-order-table/
Still working perfectly!
Thank you soooo much!!!
Great!
Hi! This does not work for me – maybe because I we are using built-in attributes. After adding this add_filter to functions.php the product links are still there in the cart, example: /shop/traffic-signs/advisory-speed/?attribute_pa_size=45x45cm&attribute_pa_sub=steel-16-guage&attribute_pa_reflct=engineer
I’m actually trying to eliminate the additional variables (starting at ?) and keep the product URL, example: /shop/traffic-signs/advisory-speed/
Not having any luck – been searching for hours.
Sounds odd. Disable all plugins but Woo and switch theme – does the snippet work?
Still works, you are brilliant. Thanks so much.
Btw I need to use Code Snippets tool for it to work.
Ok thank you
Still works. Thanks.
Awesome
Hi, how can we do that only for some products? forexample on my case I am trying to hide wp job manager listing type product from market(shop) and want to users if purchase some listing type its add to cart a product and this product coming to viewable. I just dont want that products viewable. there is a way to configurate this product id?
Hey Ongun, thanks for your comment! I suggest you take a look at “conditional logic”: https://businessbloomer.com/conditional-logic-woocommerce-tutorial/ and https://businessbloomer.com/woocommerce-conditional-logic-ultimate-php-guide/. Let me know ๐