How to Change the Sale badge text in WooCommerce ?

WooCommerce adds sale badge to the products that are on sale. If a product have lower price than the actual price, Woocommerce will add sale badge.

Some People do not like the badge Text and want to change it to something like 50% off Etc. So today, We are going to show you how to change badge text to something you like.

By default, It looks like this:


Now Add this code to the functions.php file of your theme.

[codesyntax lang=”php”]

//Woocommerce OneSALE customize text 
add_filter('woocommerce_sale_flash', 'my_custom_sale_flash', 10, 3);
function my_custom_sale_flash($text, $post, $_product)
    return '<span class="onsale">Your text here</span>';

After adding the code, It will look like this:


I hope this will work for you. If you have any Questions, then just post them in comments section.

About the author

We provide WordPress & WooCommerce Support, Maintenance and Development Services.

Leave a Reply