Website Building » WooCommerce » How Do I Change the Message in WooCommerce?

How Do I Change the Message in WooCommerce?

Last updated on January 19, 2023 @ 3:46 pm

If you’ve ever wanted to change the message that appears in the WooCommerce cart, you’re in luck! There are a few different ways to do this, depending on what exactly you want to achieve.

The first way to change the message is to use the WooCommerce_cart_empty filter. This filter allows you to modify the default message that appears when the cart is empty.

To use this filter, simply add the following code to your theme’s functions.php file:

<?php 
function my_custom_empty_cart_message() {
return 'You have no items in your cart.';
}
add_filter( 'woocommerce_cart_empty_message', 'my_custom_empty_cart_message' );
?>

In the above code, we've defined a new function called my_custom_empty_cart_message(). This function returns a custom message that will be displayed when the cart is empty.

We've then used the add_filter() function to hook our new function into the woocommerce_cart _empty filter.

Note: If you're not familiar with PHP, don't worry! This code is very simple and shouldn't cause any problems even if you're a complete beginner.

The second way to change the message is by using a plugin.

While there are many great plugins available for modifying WooCommerce behavior, our favorite is WooCommerce Custom Messages. This plugin makes it very easy to change WooCommerce messages without having to write any code. Simply install and activate the plugin, then go to "WooCommerce > Settings > Custom Messages" to configure your custom messages.

No matter which method you choose, changing the WooCommerce cart message is a relatively simple task that can be accomplished in just a few minutes. So if you've ever wanted to customize this message for your own store, now you know how!

PRO TIP: If you are planning to change the message in WooCommerce, it is important to note that this can have unintended consequences. For example, if you change the message to something that is not appropriate for your store, it could result in lost sales or even damage to your reputation.
Kathy McFarland

Kathy McFarland

Devops woman in trade, tech explorer and problem navigator.