Scale your business with our modular plugins.
Home » Blog » How to Remove Added to Cart Message in WooCommerce

How to Remove Added to Cart Message in WooCommerce

remove added to cart message - featured image
October 27, 2025||By Caesal Shrestha

Are you looking for a quick way to remove the added to cart message? Then you’ve come to the right place. Enjoy our beginner-friendly guide on removing the WooCommerce ‘Added to Cart’ message and customizing it! But first, let’s take a look at why you’d consider removing it from your website.

Why Hide Added to Cart Message?

Whenever a product is added to the cart, WooCommerce displays an “added to cart” message to your customers.

This message also includes a link to your cart or checkout page for your convenience. It depends on the customizations that you have made or your active WooCommerce theme.

While it’s a great feature to have on your website, the message may not always be necessary for your customers. In these cases, the message cannot be changed through the default WooCommerce Dashboard.

remove added to cart message - default message

Furthermore, if you’re a website owner and want a clean interface, you might need to hide obvious, unnecessary messages. Hiding them from your customers is one of the best ways to keep your website clean.

Speaking of which, the added to cart message does fall under one of the most obvious message alerts. It simply states that an item is added to the cart when the customer clicks the ‘Add to Cart’ button. Hiding it can make your website look clean without losing any vital details, and also enhance the customer experience.

Similarly, making sure your website stands out from the default WooCommerce experience can be important.

Uniqueness is a crucial factor in selling products online, and hiding the ‘added to cart’ message can also enhance it. If you don’t remove or customize it, this message will appear the same as any other WooCommerce website.

How to Remove the Added to Cart Message in WooCommerce

The easiest way to remove the Added to Cart Message in WooCommerce is by adding a PHP snippet to your theme’s functions.php file. You need to open your Theme editor and add a code snippet to your theme files.

We recommend either creating a child theme programmatically or using one of the WordPress child theme plugins for this step. A child theme saves all your changes to the functions.php file even after you update your WordPress theme.

Additionally, if you wish to revert your changes, you can always return to your central theme. But make sure you back up your WordPress website before making any modifications.

Once you switch to your child theme, open your WordPress Admin Dashboard and go to Appearance > Customize. Then, click on functions.php in the right-side Theme Files sidebar.

remove added to cart message - functions php

Now, go ahead and add the following line of script to your editor. If you aren’t comfortable making changes to the theme files, you can use code editor plugins like Code Snippets, too. Just install the plugin and update the following code in your WooCommerce store using the plugin.

add_filter( 'wc_add_to_cart_message_html', '__return_false' );

Click ‘Update file’ once you have added the code here, and you should be done. This should be enough to remove the added to cart message on your website.

As shown in the demonstration below, the “Added to Cart” message won’t be displayed to your customers after they click the “Add to Cart” button.

remove added to cart message - add to cart removed demo

How to customize the Added to Cart message

Let’s say you don’t want to remove the added to cart message completely. Instead, you just want to make some minor changes to it. If that’s the case, a similar method can be used to customize this message, too.

Then, you can show a custom message to your customers when they add a product to the cart. All you have to do is copy and paste the following code snippet into your functions.php file, just like the previous step. After that, make any necessary modifications to the code to suit your specific needs.

add_filter( 'wc_add_to_cart_message_html', 'quadlayers_custom_add_to_cart_message' );
function quadlayers_custom_add_to_cart_message() {
$message = 'Your product has been added to cart. Thank you for shopping with us!' ;
return $message;
}

Replace the text inside the $message = section of the code with your custom message just like this:

add_filter( 'wc_add_to_cart_message_html', 'quadlayers_custom_add_to_cart_message' );
function quadlayers_custom_add_to_cart_message() {
$message = 'Thank you for shopping with us! Use the code discount20 in your cart for a free 20% discount';
return $message;
}

In this demonstration, we displayed the message: “Thank you for shopping with us! Use the code discount20 in your cart for a free 20% discount.”

You can also use a different code snippet to display the product name in the message when it’s added to the cart. Just add the following code snippet to your functions.php file:

add_filter( 'wc_add_to_cart_message', 'quadlayers_custom_wc_add_to_cart_message', 10, 2 );

function quadlayers_custom_wc_add_to_cart_message( $message, $product_id ) {
$message = sprintf(esc_html__('%s has been added to your cart. Thank you for shopping!','tm-organik'), get_the_title( $product_id ) );
return $message;
}

Now, when your customers click the ‘Add to Cart‘ button, they will see the product name in the ‘Added to Cart’ message.

Once you click Update file, your changes should appear on your website when a product is added to the cart. You can also customize this message. If you want to learn more about changing your added-to-cart messages, have a look at our guide here.

Hide the “Product Was Removed from Cart” Message

You already know how to remove the added to cart message. However, when a product is removed from your cart, a similar message is also shown to your customers. This message informs them of the product’s removal and includes an undo button by default.

Since you want to maintain a clean interface on your website, removing this message can also help meet your needs. Besides, you have already removed the added to cart message. Therefore, it makes sense to remove the product removal message from your website as well.

If you’d like to remove this notification, you can do so by adding a custom snippet to your functions.php file. Just like above, go to Appearance > Theme Editor from your WordPress dashboard to open your theme editor. Then, click on functions.php in the theme files sidebar.

Now, go ahead and paste the following code snippet into the editor:

add_filter( 'woocommerce_cart_item_removed_notice_type', '__return_false' );
remove added to cart message - remove cart message php

Click the Update file button to save your changes. The next time a customer removes a product from the cart, the product removal message will not be displayed.

Bonus: Redirect to Cart or Checkout Page

By now, we hope that you can confidently remove the added to cart message. When you remove this message, you can also customize the add to cart button to redirect it directly to the cart or checkout page.

So, instead of just receiving a message, your customers will be redirected directly to their cart page or the checkout for a smoother checkout process.

1. Redirect the Add to Cart Button to the Cart Page

First, let’s examine how to enable redirects to the cart page. This is a relatively straightforward process that can be completed directly from the WooCommerce Dashboard.

To redirect the add to cart button to the cart page, open your WP Admin Dashboard and go to WooCommerce > Settings. Then, click on the Products tab and enable the “Redirect to the cart page after successful addition” option.

After you have checked this option, don’t forget to save the changes.

With this enabled, when your customers add a product to the cart, they’ll be redirected straight to the cart page. This is a great alternative when you remove the added to cart message. It is also more convenient for the customers.

2. Direct Checkout for WooCommerce

If you’d like to have your customers redirected directly to your Checkout page, you can use a PHP snippet. However, please make sure both options are disabled under the Products tab in your WooCommerce settings.

Next, add your code to the functions.php file of your child theme, as shown above. Once again, go to Appearance > Theme Editor from your WordPress dashboard and open the theme editor. Then, click on functions.php from the Theme Files sidebar.

Finally, add the following code in the editor, then click Update File.

add_filter('add_to_cart_redirect', 'quadlayers_add_to_cart_redirect');
function quadlayers_add_to_cart_redirect() {
global $woocommerce;
$lw_redirect_checkout = $woocommerce->cart->get_checkout_url();
return $lw_redirect_checkout;
}

After you add this code, the add to cart button will redirect your customers to the checkout page instead of the cart page. In this case, the “add to cart” message is also unnecessary, since they can see the products on the checkout page itself.

You can also use Direct Checkout for WooCommerce if you want a more straightforward approach for this modification. We even have a detailed guide to creating a WooCommerce direct checkout link if you need more information.

Best Practices for Managing the “Added to Cart” Message in WooCommerce

  • Keep users informed – Even if you remove the default message, ensure customers are notified when an item is added to their cart. Use alternative visual cues, such as a cart icon update or a subtle pop-up.
  • Avoid removing all notifications – Important notices such as stock levels, errors, or required fields should remain visible to avoid confusing customers.
  • Consider customizing instead of removing – A clear, branded message can enhance the shopping experience and reassure users that their action was successful.
  • Test on all devices – Whether you remove or customize the message, test the user flow on desktop, tablet, and mobile devices to ensure smooth navigation.
  • Use conditional logic wisely – If you only want to hide the message on specific pages (such as the checkout), add conditions to your code or snippets.

Frequently Asked Questions

Now, let’s take a look at some frequently asked questions about this topic.

Can I customize the “Added to Cart” message instead of removing it?

Yes. WooCommerce allows you to filter and modify the text of this message using the wc_add_to_cart_message_html hook. You can replace the default text with a custom message that better fits your store.

Will removing the message affect the cart or checkout process?

No. The message is purely a notification. Removing it will not impact the cart, checkout, or any other WooCommerce functionality.

Can I remove the message only on product pages?

Yes. You can add conditional logic to your code to hide the message only on product pages or specific templates.

How do I hide the message on the shop or category pages only?

Use a conditional function such as is_shop() or is_product_category() in your custom code to target specific pages.

Are there plugins that can remove or customize this message?

Yes. Plugins like Code Snippets allow you to safely add a function to disable the message without editing theme files.

Will this work with AJAX add-to-cart?

Yes. If you remove or customize the message via the WooCommerce filter, it applies whether the product is added via AJAX or a full page reload.

Can I style the message instead of removing it?

Absolutely. You can use CSS to change the color, font, or position of the “Added to Cart” message instead of removing it completely.

What if the message still shows after adding the code?

Clear your site cache, CDN cache, and browser cache. Also, ensure you added the code to the correct location, such as a child theme’s functions.php or a snippets plugin.

Conclusion

That ends our guide on how to Remove the Added to Cart message from WooCommerce. Removing or editing it can be a helpful option if you want to remove certain unnecessary elements from your website that clog your customers’ shopping experience.

All it requires is adding your custom PHP snippets to your functions file.

Let’s do a quick summary of all the processes we covered in today’s post:

  • Removing Added to Cart Message using a code snippet
  • Customizing the Added to Cart Message
  • Hiding the ‘Product was removed from cart’ message from WooCommerce

The snippets we’ve shown in today’s article are fairly customizable and straightforward to add. You can easily customize them and change the message to fit your website. However, if you encounter issues with adding them to your website or customizing them, please let us know in the comments section. We’ll do our best to help you!

We have even included a section to redirect the add to cart button to the cart or the checkout page. This is a great option to add to your website when you remove the added to cart message.

Moreover, if you’re looking for other ways to customize your WooCommerce shop experience, why not check out some of our other articles:

Log into your account
Forgot your password?