Change the Sale badge text in WooCommerce

If you don’t like the Sale Badge that Woocommerce prints on your products on sale, you can easily change the text if you want. No need to install plugin. Because it slows down your site speed to set up more plugins.

Open functions.php located in wp-content/themes/your-theme-name/ and add the following code at the end of it:

add_filter( 'woocommerce_sale_flash', 'wc_custom_replace_sale_text' );
function wc_custom_replace_sale_text( $html ) {
    return str_replace( __( 'Sale!', 'woocommerce' ), __( 'My sale text!', 'woocommerce' ), $html );
}
Change the Sale badge text in WooCommerce

That’s All!

One comment on “Change the Sale badge text in WooCommerce

Leave a Reply

Your email address will not be published. Required fields are marked *