Remove Added to Cart Message in Woocommerce

  • August 21, 2022

If you are looking a way to hide “added to cart message” with easy method? Then you are in right place.

To we will learn how to remove the “added to cart message” without using any plugin.

For hiding the Woocommerce alert your just need to add this code in your active theme’s functions.php file.

add_filter( 'wc_add_to_cart_message_html', '__return_false' );

just save the file and boom!!!

The “added to cart message” will not show again in your website. unless you remove this code or change the theme.

Customize the Added to Cart message

Let’s assume you don’t want to completely remove the alert message. Instead you want to change the message text. Then you can also do this with the help of below code.

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

Just paste this code in your active theme’s functions.php file and save it.

This will change your add to cart alert message in your website.

Related Post


Change “in stock” / “out stock” text in Woocommerce single product page

In this tutorial you will learn how we can change “in stock” / “out stock” text with the custom. We will use custom snippet for this. Just copy the above snippet and paste in your […]


Change product price in cart programmatically

Here we will learn, how we can change product price in cart programmatically. Add below code in your theme’s functions.php file


Change Woocommerce sold individually product setting Programmatically

Let’s assume you have a product inventory of 1000s of product and you want to sell your all product individually, what will you? Well you need to change the product setting one by one to […]