WooCommerce: Remove or Rename SALE! Badge

Here’s yet another WooCommerce simple PHP snippet if you wish to completely remove / hide the SALE! badges on the homepage, shop page, category pages and single product pages. Once again, wit a few lines of code you can achieve anything you want!

Remove SALE badge from WooCommerce Product Archive and Single Product Pages

PHP Snippet #1: Remove Sale Label on Products – WooCommerce Shop & Single Product Pages

 * @snippet       Remove SALE badge @ Product Archives and Single Product
 * @how-to        Get CustomizeWoo.com FREE
 * @author        Rodolfo Melogli
 * @compatible    Woo 3.8
 * @donate $9     https://businessbloomer.com/bloomer-armada/
remove_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_show_product_loop_sale_flash', 10 );

remove_action( 'woocommerce_before_single_product_summary', 'woocommerce_show_product_sale_flash', 10 );

PHP Snippet #2: Storefront Theme: Remove Sale Label on Products – WooCommerce

 * @snippet       Remove SALE badge @ Storefront Product Archives and Single Product
 * @how-to        Get CustomizeWoo.com FREE
 * @author        Rodolfo Melogli
 * @compatible    Woo 3.8
 * @donate $9     https://businessbloomer.com/bloomer-armada/

add_action( 'wp', 'bbloomer_remove_storefront_actions' );
function bbloomer_remove_storefront_actions() {
   remove_action( 'woocommerce_after_shop_loop_item_title',      'woocommerce_show_product_loop_sale_flash', 6 );

Is there a plugin for that?

If you’d love to code but don’t feel 100% confident with PHP, I decided to look for reliable plugins that achieve the same result. As usual, I’ve chosen WooCommerce plugin vendors based on marketplace reputation, dedicated support quality, code cleanliness, long-term reliability and – probably almost as importantly – where the “people behind” the plugin are active supporters of the WordPress ecosystem.

1. WooCustomizer

Sold by: WooCustomizer – Developed by: Zack Viljoen – 14 Day Money Back Guarantee

Editing the “SALE!” badge is one of the features of WooCustomizer, a plugin built for everyone who wants to fully customize their WooCommerce store without coding (e.g. edit buttons, badges, tabs, pages, stock display, checkout fields).

2. YITH WooCommerce Badge Management

Sold by: YITH – Developed by: YITH – 30 Day Money Back Guarantee

On top of displaying custom text badges (free version), you can also create CSS, image and advanced badges, assign product badges to specific products and/or categories, pick the badge position and much more.

Where to add this snippet?

You can place PHP snippets at the bottom of your child theme functions.php file (before "?>" if you have it). CSS, on the other hand, goes in your child theme style.css file. Make sure you know what you are doing when editing such files - if you need more guidance, please take a look at my free video tutorial "Where to Place WooCommerce Customization?"

Does this snippet (still) work?

Please let me know in the comments if everything worked as expected. I would be happy to revise the snippet if you report otherwise (please provide screenshots). I have tested this code with Storefront theme, the WooCommerce version listed above and a WordPress-friendly hosting on PHP 7+.

If you think this code saved you time & money, please join other Business Bloomer supporters and avail of 365 days of WooCommerce benefits. Thank you in advance :)

Need Help with WooCommerce Customization?

Check out these free video tutorials. You can start learning how to customize WooCommerce without unnecessary plugins. Watch me code and learn by example!

  • how-to-edit-woocommerce-with-php-snippets
  • woocommerce-hooks-add_action-list-visual
  • woocommerce-customize-single-product-page-PHP

Rodolfo Melogli

Author, WooCommerce expert and WordCamp speaker, Rodolfo has worked as a WooCommerce freelancer since 2011. His goal is to help entrepreneurs and developers overcome their WooCommerce nightmares. Rodolfo loves travelling, chasing tennis & soccer balls and, of course, wood fired oven pizza.

25 thoughts on “WooCommerce: Remove or Rename SALE! Badge

  1. Just used this code (wordpress version 5.2.3), worked perfectly.
    Thanks so much Rodolfo!

    1. Excellent!

  2. Well done mate. Code worked straight away.

    1. Thank you!

  3. it still works awesome and at last thanks.
    wordpress version 5.0.3 as 12/2/2019.

    1. Great!

  4. Rodolfo, this worked perfectly. Thanks!

    1. Awesome 🙂

  5. how to add lable badge for instance new and any custom text without plugins

  6. Hello, Rodolfo!
    First of all thanks for all great job that you do here.

    I have a question. I want to remove a sale flash on a shop page and after adding your snippet to my theme’s functions.php nothing had changed – the sale flash is still there.

    I’m using a Storefront theme.

    The snippet I’ve added:

     remove_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_show_product_loop_sale_flash', 10 ); 

    What might me a problem?


    1. Hello Iryna, thanks for your comment 🙂 I’ve updated the page with a second snippet specific to Storefront theme. Hope this helps

  7. Code works but I wanted to combine it with code provided in your conditional logic page that you linked. I cannot seem to get it to work tho. What I tried was this:

    add_action( 'woocommerce_after_single_product_summary', 'bbloomer_single_product_type' );
    function bbloomer_single_product_type() {
    if( $product->is_type( 'variable' ) ){
     * @snippet       Remove SALE badge @ Product Archives and Single Product
     * @how-to        Get CustomizeWoo.com FREE
     * @sourcecode    https://businessbloomer.com/?p=17429
     * @author        Rodolfo Melogli
     * @compatible    WooCommerce 3.2.3
    remove_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_show_product_loop_sale_flash', 10 );
    remove_action( 'woocommerce_before_single_product_summary', 'woocommerce_show_product_sale_flash', 10 );

    I added this code as one of my snippets. What happened is that the sake flash was still there but the images on all product pages where removed? What I wanted to do was use this logic but on a product type called “smart bundle” that I use a plugin to create. I thought I’d debug by trying a standard product type from Woocommerce and this is the result. Why can’t I combine the code lines like this?

    Thanks in advance!

    1. Hey Niklas, thanks so much for your comment! I think you’re trying to access $product without declaring it first. Try adding this to the beginning of the function (also, please take the comments out and place them outside the PHP, they’re not great there):

      global $product;
  8. Is there a way to do this selectively? Where it the sale “icon” doesn’t appear for small discounts like 10-20%? But will appear on discounts of say 50% and more to indicate “Clearance”?

    Thanks, I know this post is old and I may not get a reply.

  9. Yes it works! Thnx.

  10. Hello Rodolfo,

    I placed the above code at the end of my Child Theme’s functions.php file. It gave an overall error poping below message;

    ‘HTTP 500 error
    That’s odd… the website can’t display this page’

    What could have gone wrong?

    1. Tory, thanks for your comment! Not sure… have you pasted the code after “?>” maybe? It should be before that line.

  11. Hi.. I tried your snippet it removes the sale badge only in the single product page.

    Sale badge is still visible on the shop page.

    I dont wanna use css bcoz i am trying to hide the sale badge only for the users who are not logged in

    1. Hey Santhosh thanks for your comment! The only reason one works and the other doesn’t is that your theme is overriding the default WooCommerce functionality – both actions come from WooCommerce code. Take a look through your theme’s functions and see if you need to tweak something in the remove_action 🙂 Hope this helps!

  12. Hi … I read your post about removing the Sale box on woo commerce and put in the code below on my theme’s ccs box and it did not work … am I missing something

    remove_action( ‘woocommerce_before_shop_loop_item_title’, ‘woocommerce_show_product_loop_sale_flash’, 10 );
    remove_action( ‘woocommerce_before_single_product_summary’, ‘woocommerce_show_product_sale_flash’, 10 );

    I very much appreciate your advice. Jan

    1. Hey Jan thanks for your comment 🙂 There is a chance that your theme, Jupiter, is adding custom sale badges and therefore the WooCommerce remove_action won’t work. Can you look through the files of your theme (File Search) for this string “woocommerce_show_product_sale_flash” and let me know what you’ve found?

      1. Jan – you put this in the CSS? It should go in the functions.php file.

Questions? Feedback? Support? Leave your Comment Now!

If you are writing code, please wrap it between: [php]code_here[/php]. Failure to complying with this (as well as going off topic) will result in comment deletion. You should expect a reply in about a week - this is a popular blog but I need to get paid work done first. Please consider joining #BloomerArmada to ask me 1-to-1 WooCommerce questions. Thank you :)

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