Add this PHP to the end of your child themes functions file or custom code snippets plugin.
add_filter('woocommerce_out_of_stock_message', 'custom_out_of_stock_message');
function custom_out_of_stock_message() {
return __('Your Custom Out of Stock Message.', 'woocommerce');
}
Once you install the code, change the ‘Your Custom Out of Stock Message.’ text within the single quotes to anything you like. Do NOT remove the single quotes.
You can extend this code to do anything you like.
Need More Coding Help?
Book a Consultation
Related Code Snippets & Tutorials
- Show Out of Stock Products for Specific User Role
- Custom Out of Stock Text for Specific Product Ids
- Set Out of Stock Threshold Per Product WooCommerce
Was this helpful?
Thanks for your feedback!

Leave a Reply
You must be logged in to post a comment.