Learn in this tutorial how to remove the price of out of stock or sold out products in WooCommerce with a simple code snippet.
By default, WooCommerce continues to display the price of a product even if it is sold out.
But you may prefer to hide it in case there is a change of supplier and thus an associated price change or something similar.
Interested? Here’s how to do it:
Snippet to remove the price on WooCommerce products that are out of stock
Add the following code at the end of functions.php or in your functionality plugin:
To see this and another 917 code snippets of this website, login or subscribe here.
It’s as simple as that.
Conclusion
As you can see, with a few lines of code you can prevent the price of a WooCommerce out of stock product from being displayed.
Any questions? I read you in the comments.
And if you want to give me any suggestion for future tutorials, leave it in the contact form. Advantages of being a subscriber. 😉