How to Remove WooCommerce Cart Product Links

The cart template provided by WooCommerce is a pretty inflexible piece of the plugin. The default layout comes with a lot of small design choices and pieces of information that are not always worth including and can sometimes be frustrating for store owners to have to deal with.

One such feature is the automatic inclusion of product links inside the cart’s list of items your customers are purchasing. Cart links are meant to give your buyers an easy way to go back and look at what they have in their cart in more detail.

Cart Product Link in WooCommerce
An example Cart Product Link in WooCommerce

Of course, you might not want to give them that choice or perhaps you are adding items automatically to the cart and don’t need that extra piece of navigation to be available.

A little bit of theme editing is all you need to remove these product links from the cart. You’ll need to hire a WordPress developer or WooCommerce expert to handle this for you.

An alternative that doesn’t require editing your theme or finding and hiring a qualified person to work on your site is to use our Remove WooCommerce Features plugin.

How to Hide WooCommerce Cart Product Links with Code

You can take care of this yourself if you aren’t afraid to learn a bit about the inner workings of WordPress themes. We’ll give you a brief rundown of the process of safely adjusting WooCommerce store layouts with code.

Warning! Please make a complete backup of your site. This includes your WordPress theme and the site’s database as well (just to be safe). If something goes wrong you will need to be able to revert back to a working version of your site.

Create a Child Theme

The first step is to create a child theme. You can learn how to create a WordPress child theme online. Child themes are a way for WordPress site owners to adjust their site’s layout safely. In short, a child theme will load its parent theme’s files first and then apply any changes it might have last. This method allows for a parent theme to receive updates and fixes without risking any loss of code.

Add Code to the Child Theme

Once the child theme is ready it is time to add some code to it. Create a file called functions.php inside of your new child theme. This is the file where we will be inserting our code. Open the file in any text editor and add the following:

add_filter( 'woocommerce_cart_item_permalink', 'my_remove_cart_product_link', 10 );
function my_remove_cart_product_link() {
    return __return_null();

Save your functions.php file and you are ready to move on to the next step.

Upload the Child Theme to Your Site

This next step can be pretty technical. You’re going to need to use an FTP program to upload your child theme to the site’s server. Your web host should have instructions on how to get this done. Some hosting providers also offer assistance through their support staff as well. Once you have the child theme files on the server it’s time to turn it on.

Are you lost or confused yet? Adding a few lines of code to a WordPress site, the correct way seems simple but can be daunting. You can avoid having to create child themes or upload files. Skip ahead to learn how our Remove WooCommerce Features plugin can help.

Active the Child Theme

You should be able to go to the Appearance menu inside of the WordPress admin and see your theme. Activate it and, if everything has gone smoothly, the product links should be removed from your cart.

If your links are still there or, even worse, the entire site is broken it’s time to start from the top. Check your code to make sure you have added it to the functions.php file correctly. Look again at the server to confirm the child theme’s files are uploaded properly.

Assuming everything went well it’s time to pat yourself on the back. You made a code change to your WooCommerce site on your own. You did it the safe way, with a child theme, and learned how to upload files directly to your server.

Of course, this isn’t for everyone. There’s a simpler way to turn off product links in WooCommerce carts.

Disable Product Links from the WooCommerce Cart in Seconds

Remove WooCommerce Features can take care of all of this for you. The best part is you won’t have to write a single line of code or upload any complex files.

After purchasing and installing our Remove WooCommerce Features plugin the steps to remove product links is simple:

Step #1

Go to the WooCommerce section of your WordPress installation’s admin menu and click the link that says Remove Features.

WooCommerce Admin Menu

Step #2

Find the setting for Cart Product Link and click the checkbox so that it’s marked like so:

Remove WooCommerce Features - Cart Product Link

Step #3

Press the button.

Remove WooCommerce Features will disable product links from your cart as soon as you’ve hit the save button. Your setting will remain. This will be true no matter how often your theme updates or changes.

You’ll never have to edit any code or remember to pay your WordPress developer again to take care of this problem if you use our plugin.

The plugin handles a bunch of other features as well that are commonly frustrating to WooCommerce users. With Remove WooCommerce Features you can:

Remove WooCommerce Features Logo