Product Archive, Product Page

WooCommerce Rename The Sale Badge

WooCommerce product and archive page showing custom sale badge text

Pre-Requisites

There are no pre-requisites in order for you to be able to implement this solution.

How To Implement This Solution?

Simply copy the pre-coded solution to your active theme’s functions.php or preferably the Code Snippets Plugin.

About This Solution

In some contexts, the default “Sale!” badge shown on WooCommerce Product Arhive pages, single product pages, and on cross-sells and upsells may need to be changed. This quick guide shows you how to change this text to something completely custom to meet your business requirements. In this particular example, we have changed the text to “Price Cut!”.

/**
* Snippet Name:     Change the WooCommerce sale badge.
* Snippet Author:   ecommercehints.com
*/

add_filter( 'woocommerce_sale_flash', 'ecommercehints_rename_sale_badge', 10, 2 );

function ecommercehints_rename_sale_badge( $badge_html, $post ) {
	return '<span class="onsale">Price Cut!</span>';
}

Snippet Benefits

  • Customise text to be inline with your business branding and wording.
  • Change the on sale badge text to literally anything you like – changing it in this one place, will change it everywhere it is displayed.

100 WooCommerce Conversion Rate Optimisation Tips

This field is for validation purposes and should be left unchanged.

Let’s collaborate!

Need to outsource WordPress development?

Join forces with UnlimitedWP for an outsourced white label web development service you can truly rely on.

First Timer Here?

Sign up to receive 10% off on your first month with us.

26027
WELCOME OFFER