How to Hide “Product has been added to your cart” message in WooCommerce?

Learn how to hide the product has been added to your cart message on the WooCommerce Cart page.

Use the video below as a resource.

Here are a few snippets you can use to hide or customize the add-to-cart message.

Snippet #1: Hide the “Product Added to Your Cart” message

Copy/paste the snippet below using the Code Snippets plugin. You could also add the snippet below to the bottom of your functions.php file.

add_filter( 'wc_add_to_cart_message_html', '__return_false' ); 

Snippet #2: Hide the “Product Removed. Undo?” message

add_filter('woocommerce_cart_item_removed_notice_type', '__return_null');

Snippet #3: Customize the “Product Added to Your Cart” message

If you want to modify the default message use the following snippet below as a guide.

function custom_wc_add_to_cart_message( $message, $product_id ) { 

	$message = sprintf( '%s has been added to your cart.', get_the_title( $product_id ) ); 

	return $message; 

}

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

Video

If you are more of a visual learner I go into more detail on how to do this!

Simon Gondeck

Iā€™m a big fan of WordPress + WooCommerce (especially WooCommerce Subscriptions). Check out my YouTube channel.

Leave a Comment