WooCommerce: Change “Out of stock” to “Sold”

Change the way WooCommerce displays the “Out of stock” products message to a simple “Sold”.

When the stock level for a WooCommerce product reaches zero, the message displayed on the single product page is “Out of stock”.

The code below will allow you to change that message to anything you like, for example a simple “Sold” word.

No bananas were harmed in the making of this blog post!

Where To Put The Code Snippet?

This code snippet should go in your active theme’s functions.php file.

Add it to the bottom of the file, before any closing ?> characters.

It’s always a good idea to take a backup of your functions.php file in case anything goes wrong – you can just copy the old code back in again.

Was this article helpful?

Keep In Touch


Wil is a dad, WordPress consultant, WordPress developer, business coach and mentor. He co-organizes the WordPress Sydney meetup group and has been on the organising committee for WordCamp Sydney since 2014. He speaks at many special events and contributes to the WordPress open source project. His likes are chillies, craft beer and electrogravitics.