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 );
}

C:\Users\serkan\Google Drive\WPMPT\images\featured-images\Change_the_Sale_badge_text_in_WooCommerce.png

That’s All!

Leave a Reply