Remove or edit “[Product] has been added to your cart” message in WooCommerce

If you’re a WooCommerce user, you know that when you add a product to your cart, a message pops up that says “[Product Name] has been added to your cart.” While this is helpful for some users, others may find it annoying.

In this post, I’m going to show you how to remove the “Product has been added to your cart” message in WooCommerce. This should be helpful for those who find it annoying or distracting.

//remove
add_filter( 'wc_add_to_cart_message_html', '__return_null' );

If you only want to change the message to a more suitable one for your store, that’s possible too.

//edit
add_filter( 'wc_add_to_cart_message_html', 'my_theme_custom_add_to_cart_message' );
function my_theme_custom_add_to_cart_message() {
   $message = 'Thank you for purchasing this product';
   return $message;
}

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close