Change Woocommerce Out of Stock Text

Here’s how to change or modify the Woocommerce Out of Stock text. You can also change other availability texts like ‘Available on backorder’. Place the following in your theme’s functions.php file.

add_filter( 'woocommerce_get_availability_text', 'az_change_stock_text');

function az_change_stock_text($text){
 switch($text){
   caseĀ  'Out of stock':
     $text = 'Temporarily out of stock';
   break;
   case 'Available on backorder':
     $text = 'Available on backorder';
   break;
 }
 return $text;
}

This works by examining the $text before it is displayed. You match that text in the switch statement and then change it to something else.