Hide the WooCommerce “on sale” badge in Astra themes
Published by John Jago
Summary
This is a tutorial on how to remove the “sale!” or “on sale” badges from the product image on the shop page and on product pages in WooCommerce when using an Astra theme. It assumes no coding experience and goes through each step with screenshots.
If you’ve seen these sale banners on products in your WooCommerce store, and you want them gone, here’s how you can do it while still keeping the items on sale.
For most Astra themes
WordPress is transitioning to an interactive site editor instead of the classic “Customize” menu, but for most older themes and likely many Astra themes, you can add custom code to hide the sale badges using the following steps.
- Go to your site’s dashboard (log in to WordPress).
- In the side navigation, go to Appearance → Customize → Additional CSS.
- Paste the following code:
.ast-onsale-card { display: none !important; }
- Click the “Save Changes“ button.
After doing this, you should no longer see the sale badge on either the shop page or product page, even if the item is on sale.
For the new WordPress site editor
If the theme supports the new WordPress site editor (released in 2022 and becoming more popular among themes in the following years), the steps are a little different.
- Go to your site’s dashboard (log in to WordPress).
- In the side navigation, go to Appearance → Editor.
- Click on “Styles”.
- Click the pencil icon to edit styles.
- At the bottom, open “Additional CSS”.
- Paste the custom code into the box:
.ast-onsale-card { display: none !important; }
- Click “Save”.
👋 Hey there! We’re the creators of Dashify, a free plugin that transforms the WordPress admin into an ecommerce-focused dashboard, helping you manage your store faster and more effectively.