WordPress filter hook
woocommerce_out_of_stock_message
Defined by WooCommerce and fired by 33 plugins in total, running on 7.3M+ sites between them.
“(Ignore this hook. It is a standard WooCommerce hook.) phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound”
How to use woocommerce_out_of_stock_message
It's a filter: your callback receives the value, and must return the (changed) value.
Add this to your theme's functions.php or a small custom plugin:
add_filter( 'woocommerce_out_of_stock_message', function( $_ ) {
// Change $_ here.
return $_;
}, 10, 1 );Argument names come from WooCommerce's source. Other plugins may pass different values: check the call in the plugin you're targeting below.
33 plugins that fire woocommerce_out_of_stock_message
Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.
-
WooCommerce7+ million installs
apply_filters( 'woocommerce_out_of_stock_message', __( 'This product is currently out of stock and unavailable.', 'woocommerce' ) )templates/single-product/add-to-cart/variable.php:44 -
Variation Swatches for WooCommerce200,000+ installs
apply_filters( 'woocommerce_out_of_stock_message', __( 'This product is currently out of stock and unavailable.', 'variation-swatches-woo' ) )inc/swatches.php:482 -
ShopLentor80,000+ installs
apply_filters( 'woocommerce_out_of_stock_message', __( 'This product is currently out of stock and unavailable.', 'woolentor' ) )includes/modules/variation-swatch/includes/Frontend/Woo_Config.php:835 -
YITH Color and Label Variations for WooCommerce8,000+ installs
apply_filters( 'woocommerce_out_of_stock_message', __( 'This product is currently out of stock and unavailable.', 'woocommerce' ) )templates/single-product/add-to-cart/variable-wccl.php:27 -
WPC Variation Swatches for WooCommerce6,000+ installs
apply_filters( 'woocommerce_out_of_stock_message', __( 'This product is currently out of stock and unavailable.', 'wpc-variation-swatches' ) )templates/variable.php:35 -
Swatchly5,000+ installs
apply_filters( 'woocommerce_out_of_stock_message', __( 'This product is currently out of stock and unavailable.', 'swatchly' ) )includes/Frontend/Woo_Config.php:713 -
WPFunnels5,000+ installs
apply_filters( 'woocommerce_out_of_stock_message', __( 'This product is currently out of stock and unavailable.', 'wpfnl' ) )public/modules/checkout/templates-style/variable-product.php:51 -
Product Table for WooCommerce5,000+ installs
apply_filters( 'woocommerce_out_of_stock_message', __( 'This product is currently out of stock and unavailable.', 'woo-product-table' ) )includes/variation_html.php:14 -
Smart Variation Swatches for WooCommerce3,000+ installs
apply_filters( 'woocommerce_out_of_stock_message', __( 'This product is currently out of stock and unavailable.', 'woocommerce' ) )inc/class-frontend-archive.php:213 -
WC Variations Radio Buttons3,000+ installs
apply_filters( 'woocommerce_out_of_stock_message', __('This product is currently out of stock and unavailable.', 'woocommerce') )templates/single-product/add-to-cart/variable.php:30 -
PVT1,000+ installs
apply_filters( 'woocommerce_out_of_stock_message', __( 'This product is currently out of stock and unavailable.', 'product-variant-table-for-woocommerce' ) )inc/frontend/class_pvtfw_available_btn.php:68 -
Direct Checkout1,000+ installs
apply_filters( 'woocommerce_out_of_stock_message', esc_html__( 'This product is currently out of stock and unavailable.', 'woocommerce' ) )includes/AddToCart.php:554 -
Product Variation Swatches for WooCommerce700+ installs
apply_filters( 'woocommerce_out_of_stock_message', __( 'This product is currently out of stock and unavailable.', 'smart-swatches' ) )src/Frontend/Frontend.php:1123 -
ShopPress600+ installs
apply_filters( 'woocommerce_out_of_stock_message', __( 'This product is currently out of stock and unavailable.', 'woocommerce' ) )public/templates/single-product/product-add-to-cart-variable.php:35 -
StoreBuild400+ installs
apply_filters( 'woocommerce_out_of_stock_message', __('Not in stock', 'shopbuild') )public/class-pure-wc-shopbuild-compare.php:377 -
Visual Builder200+ installs
apply_filters( 'woocommerce_out_of_stock_message', __( 'This product is currently out of stock and unavailable.', 'woocommerce' ) )inc/woocommerce/single-product/add-to-cart/variable.php:141 -
Modal COD Form for woocommerce100+ installs
apply_filters( 'woocommerce_out_of_stock_message', __( 'This product is currently out of stock and unavailable.', 'modal-cod-form' ) )includes/modalcodf-shop-extensions/modalcodf-ext-shortcodes.php:442 -
TPure Variation Swatches for WooCommerce100+ installs
apply_filters( 'woocommerce_out_of_stock_message', __( 'This product is currently out of stock and unavailable.', 'tpure-variation-swatches' ) )public/Frontend.php:289 -
Shopready100+ installs
apply_filters( 'woocommerce_out_of_stock_message', __( 'This product is currently out of stock and unavailable.', 'shopready-elementor-addon' ) )src/extension/elewidgets/widgets/product/template-parts/add_to_cart/types/variable.php:33 -
Show Variations For WooCommerce100+ installs
apply_filters( 'woocommerce_out_of_stock_message', __( 'This product is currently out of stock and unavailable.', 'woocommerce' ) )public/class-wsv-public.php:321 -
AMP WooCommerce90+ installs
apply_filters( 'woocommerce_out_of_stock_message', __( 'This product is currently out of stock and unavailable.', 'amp-woocommerce' ) )templates/single-product/add-to-cart/variable.php:72 -
B2B Request a Quote40+ installs
apply_filters( 'woocommerce_out_of_stock_message', __( 'This product is currently out of stock and unavailable.', 'woocommerce' ) )includes/public/views/hide-variable-add-to-cart-btn.php:39 -
SizeMe for WooCommerce30+ installs
apply_filters( 'woocommerce_out_of_stock_message', __( 'This product is currently out of stock and unavailable.', 'woocommerce' ) )woocommerce/single-product/add-to-cart/variable.php:52 -
VariationPress for WooCommerce10+ installs
apply_filters( 'woocommerce_out_of_stock_message', esc_html__( 'This product is currently out of stock and unavailable.', 'woocommerce' ) )templates/loop.php:108 -
Templates Add-on for Woo OnePage10+ installs
apply_filters( 'woocommerce_out_of_stock_message', __( 'This product is currently out of stock and unavailable.', 'woocommerce' ) )includes/variation-swatch/templates/add-to-cart/variable.php:25 -
Peleman Webshop Plugin10+ installs
apply_filters( 'woocommerce_out_of_stock_message', __('This product is currently out of stock and unavailable.', 'woocommerce') )templates/woocommerce/variable.php:34 -
WooMultiOrder: Add Multiple Products to Cart with Elementor10+ installs
apply_filters( 'woocommerce_out_of_stock_message', __( 'This product is currently out of stock and unavailable.', 'woocommerce' ) )public/partials/variation_product_show.php:65 -
Quicker10+ installs
apply_filters( 'woocommerce_out_of_stock_message', esc_html__( 'This product is currently out of stock and unavailable.', 'quicker' ) )templates/quick-view/variable.php:18 -
Template Builder Elementor10+ installs
apply_filters( 'woocommerce_out_of_stock_message', esc_html__('This product is currently out of stock and unavailable.', 'tmpenvo') )includes/elementor/widgets/woocommerce/templates/addtocart/tmpenvo-variableproduct.php:28 -
MoreConvert Compare for WooCommerceFewer than 10 installs
apply_filters( 'woocommerce_out_of_stock_message', __( 'This product is currently out of stock and unavailable.', 'moreconvert-compare-for-woocommerce' ) )includes/class-ajax-handler.php:149 -
Imaginate Variation Display Options for WooCommerceFewer than 10 installs
apply_filters( 'woocommerce_out_of_stock_message', __( 'This product is currently out of stock and unavailable.', 'imaginate-variation-display-options-woocommerce' ) )includes/templates/imaginate-variation-display-options-woocommerce-add-to-cart-variable.php:27 -
FoodMaster LiteFewer than 10 installs
apply_filters( 'woocommerce_out_of_stock_message', __( 'This product is currently out of stock and unavailable.', 'woocommerce' ) )templates/modal/add-to-cart/variable.php:30 -
Product Variant Dropdown or Radio Button for WooCommerceFewer than 10 installs
apply_filters( 'woocommerce_out_of_stock_message', __( 'This product is currently out of stock and unavailable.', 'product-variant-dropdown-radio-button' ) )public/templates/single-product/add-to-cart/variable.php:32
Need a customisation built on this hook?
Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.