Change Woocommerce Sale Badge Text

Add this to functions.php; update the placeholder “Your Text Here” with your new badge text:

add_filter( 'woocommerce_sale_flash', 'wc_custom_replace_sale_text' );
function wc_custom_replace_sale_text( $html ) {
    return str_replace( __( 'Sale!', 'woocommerce' ), __( 'Your Text Here', 'woocommerce' ), $html );
}

Sourced here.

The sourced post also mentions a plugin (Sale Flash Pro) that allows you to bring the discount percentage into this badge area.

Leave a Reply

katherine as a flat graphic icon

About Me

I’m an African / Ojibwe First Nations Web Developer living in Winnipeg, Manitoba.

Visit the Tips and Blog to see what I’m working on.