This plugin hasn’t been tested with the latest 3 major releases of WordPress. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.

Sold Out Badge for WooCommerce


Display a “Sold Out!” badge on out-of-stock products.
When a WooCommerce product becomes out of stock, this plugin will show a badge on thumbnail with the text you will have defined.

This plugin was initially created to help people and companies selling unique products or services, like artists, artisans, real estate professionals, etc. It is often beneficial for them to keep showing sold out (out of stock) products on their websites, while displaying a message indicating that the product can’t be sold anymore.

However, this plugin can be used by anyone wanting to display any text in a badge when a product is out of stock.

It is also possible to display a badge on backorder products.

Usage & Documentation

You can customize options in Settings > Sold Out Badge for WooCommerce

What can I customize in this plugin ?

  • Badge text (you can replace “Sold Out” with any text you want, like “Out of stock” or “Coming Soon“)
  • Badge background color
  • Badge text color
  • Badge font size
  • Badge width
  • Badge height
  • An option to hide “Sale” badge if you get an overlap (checked by default)



  • Single product page
  • Store and categories pages
  • Admin settings


  1. Install this plugin either via the plugin directory, or by uploading the files to your server.
  2. Activate the plugin.
  3. That’s it. You’re ready to go! Please, refer to the Usage & Documentation section for examples and how-to information.


Is this plugin completely free?


Can I use this plugin for commercial purposes?

Sure, go ahead! It is completely open source.

Can I change the badge text?

Yes. Go to Settings > Sold Out Badge for WooCommerce, you’ll find the setting you want.

What if this plugin isn’t compatible with my theme or doesn’t work?

You could uninstall this plugin and try to get the badge manually. There are two ways you could do it:

1. Pure CSS

If you’re lucky enough, you’ll have a specific CSS class for out-of-stock products.
You could add a SOLD OUT badge like this:

.product.outofstock:before {
     content: 'SOLD OUT';
     color: #ffffff;
     background: #FE2121;
     font-size: 16px;
     padding: 4px;
     font-weight: bold;
     width: auto;
     height: auto;
     border-radius: 0;
     z-index: 9999;
     text-align: center;
     position: absolute;
     top: 6px;
     right: auto;
     bottom: auto;
     left: 6px;

2. PHP + CSS

Otherwise, you could use WP hooks to add a badge. Put this code in your child theme’s functions.php:

add_action( 'woocommerce_before_shop_loop_item_title', 'my_custom_soldout_badge_display', 10 );
add_action( 'woocommerce_before_single_product_summary', 'my_custom_soldout_badge_display', 30 );

function my_custom_soldout_badge_display() {
    global $post, $product;

    if ( ! $product->is_in_stock() ) {
        echo '<span class="wcsob_soldout">SOLD OUT</span>';

Use the following CSS code to style the badge:

.wcsob_soldout {
     content: 'SOLD OUT';
     color: #ffffff;
     background: #FE2121;
     font-size: 16px;
     padding: 4px;
     font-weight: bold;
     width: auto;
     height: auto;
     border-radius: 0;
     z-index: 9999;
     text-align: center;
     position: absolute;
     top: 6px;
     right: auto;
     bottom: auto;
     left: 6px;


ayidosun 25, 2024
Bonjour,Je viens de mettre votre extension en place : 3′ , j’ai compris comment ça fonctionne, mis en place, et… tout va bien ! Merci d’avoir fait aussi simple.En pré-production. WordPress 6.5.5, GeneratePress (3.4 )Enfant , Spectra 2.13.7 PHP 8.2. Woocommerce 9.02.Merci ! Bonne continuation.
liyasun 9, 2023
Exactly what I was looking for, simple and very easy to set up too. Thank you!
Zofinkplɔsun 16, 2023
Install and activate the plugin and it just works. Easy to tweak colors position. Just the right amount of settings.
kɔnyasun 26, 2022
Spent far too long looking for a badge that was simple and quick to use. For whatever reason, my theme didn’t have a default out of stock/sold out badge. This plugin is simple and works slick!
Read all 24 reviews

Contributors & Developers

“Sold Out Badge for WooCommerce” is open source software. The following people have contributed to this plugin.


“Sold Out Badge for WooCommerce” has been translated into 5 locales. Thank you to the translators for their contributions.

Translate “Sold Out Badge for WooCommerce” into your language.

Interested in development?

Browse the code, check out the SVN repository, or subscribe to the development log by RSS.



  • Support PHP 8.2
  • Bump Carbon Fields version to 3.6.0
  • Improve docs


  • Fix compatibility issues with kadence blocks and woocommerce HPOS thanks to @ataypamart


  • Fix missing hook in Elementor page builder


  • Fix related and upsells products in some themes like Divi


  • Adds compat with Elementor Archive posts widget


  • Allows displaying badge on backorder products instead of/in addition to out of stock products


  • Adds WPML compatibility


  • Fixes Text Domain Path
  • Fixes single product position settings being ignored


  • Major code refactor (nothing is supposed to change unless you made custom dev using this plugin hooks or classes )
  • Added compatibility with Lay Theme


  • Minor fixes


  • Fixes and improves alternative method
  • Improves compatibility with Divi Builder on single product pages


  • Adds an alternative method (pure CSS). Useful for some themes like Divi.


  • Adds badge in search results
  • Ability to turn off the badge on a per-product basis


  • Fix missing “position: absolute” CSS rule


  • Potential breaking change (in other words, do a backup before upgrading) : Adds settings options to control appearance (width, height, border-radius, etc.)


  • Move to Singleton pattern to let other developpers unhook actions and filters.
    If you want to unhook something, use it like this, for example: remove_filter( 'woocommerce_get_stock_html', [ WCSOB::get_instance(), 'replace_out_of_stock_text' ], 10, 2 );