How to Show the Discount Percentage on WooCommerce Sale Badges
WooCommerce marks discounted products with a plain “Sale!” badge. It tells shoppers something is cheaper, but not how much cheaper, and that’s what makes people click. Showing the discount percentage on WooCommerce sale badges, such as “-25%” or “Save 30%,” turns a generic label into a reason to buy.
In this guide, you’ll learn why percentage badges work, how to set them up with a plugin or code, how to handle variable products and how to design badges that don’t clutter your shop.
Why Show the Discount Percentage?
- Specific beats generic: “-40%” grabs attention far more than “Sale!”
- Faster decisions: shoppers don’t have to compare old and new prices themselves.
- Better browsing: on shop pages, the biggest discounts stand out immediately.
- Consistency with marketplaces: Daraz, Amazon and most large retailers show percentage discounts, so shoppers expect it.
How to Show Percentage Sale Badges With a Plugin
Dynamic Sale Badges from Simpli Plugin is a free plugin that replaces WooCommerce’s generic “Sale!” label with badges calculated from your real prices. You can show the percentage off or the amount saved, and it handles both simple and variable products.
- Download the plugin ZIP from its product page.
- Go to Plugins → Add New Plugin → Upload Plugin.
- Upload the file, click Install Now, then Activate Plugin.
- Open the plugin settings and choose the badge style and text.
- Check a few sale products on your shop page and product pages.
How to Show Percentage Sale Badges With Code
WooCommerce passes the badge through the woocommerce_sale_flash filter. This snippet shows the percentage for simple products:
add_filter( 'woocommerce_sale_flash', function ( $html, $post, $product ) {
if ( $product->is_type( 'simple' ) ) {
$regular = (float) $product->get_regular_price();
$sale = (float) $product->get_sale_price();
if ( $regular > 0 && $sale > 0 ) {
$percent = round( ( ( $regular - $sale ) / $regular ) * 100 );
return '<span class="onsale">-' . $percent . '%</span>';
}
}
return $html;
}, 10, 3 );
The badge keeps WooCommerce’s onsale class, so it inherits your theme’s existing badge styling. Add the snippet through a custom plugin or child theme.
Variable Products
Variable products can have a different discount on each variation, for example 10% off the small size and 25% off the large. Common approaches are:
- Show the highest discount, labelled “Up to -25%.”
- Show the discount of the selected variation once the customer picks an option.
- Keep the generic “Sale” label for variable products.
Showing “Up to” is the most honest option on shop pages, because the exact discount depends on the variation chosen.
Want badges for “New,” “Bestseller,” “Low stock” or custom campaign labels across your store? Simpli Plugin’s team builds custom WooCommerce merchandising features.
Sale Badge Design Tips
| Do | Avoid |
|---|---|
| Keep text short: “-25%” or “Save 25%” | Long phrases that cover the product photo |
| Use one consistent badge colour | Different colours on every product |
| Place badges in the same corner | Badges that move between pages |
| Round percentages to whole numbers | “-23.47%” |
| Only show real discounts | Inflated “regular” prices to create big percentages |
Fake reference prices aren’t just bad practice. Consumer protection rules in many countries restrict misleading discount claims.
Common Problems and How to Fix Them
The Badge Still Says “Sale!”
Your theme may output its own badge instead of using WooCommerce’s filter. Check the theme’s WooCommerce settings, or ask the theme developer which hook it uses.
Badges Show on Products Without a Discount
Check for a sale price that’s equal to the regular price, or a scheduled sale that hasn’t ended. Remove the sale price where it isn’t needed.
Percentages Look Slightly Off
Rounding can show 33% for a discount of 33.3%. Make sure the badge rounds consistently, and check that tax display settings aren’t mixing prices with and without tax.
Related Guides
- How to Create a Buy One Get One (BOGO) Offer in WooCommerce
- How to Create a WooCommerce Coupon Link
- How to Add Order Bumps to WooCommerce Checkout
Frequently Asked Questions
Can WooCommerce show the discount percentage by default?
No. WooCommerce shows a generic “Sale!” label. You need a plugin or a small code snippet to show the percentage.
Does a percentage badge work for scheduled sales?
Yes. The badge appears whenever the sale price is active and disappears when the sale ends.
Should I show a percentage or an amount?
Percentages work well for cheaper items, while amounts such as “Save Rs 2,000” can look stronger on expensive products. Test both.
Will custom badges slow down my shop?
No. Badges are simple text calculated from prices WooCommerce already loads.
Turn “Sale” Into a Reason to Click
A percentage badge tells shoppers exactly how good a deal is, right on the product image. Show real discounts, keep badges short and consistent and handle variable products honestly.
Download Dynamic Sale Badges for free, and explore more free WooCommerce plugins from Simpli Plugin.