WordPress filter hook

woocommerce_empty_price_html

Defined by WooCommerce and fired by 18 plugins in total, running on 7M+ sites between them.

How to use woocommerce_empty_price_html

It's a filter: your callback receives the value and 1 more argument, and must return the (changed) value. Add this to your theme's functions.php or a small custom plugin:

functions.php
add_filter( 'woocommerce_empty_price_html', function( $value, $product ) {
	// Change $value here.
	return $value;
}, 10, 2 );

Argument names come from PeachPay's source. Other plugins may pass different values: check the call in the plugin you're targeting below.

18 plugins that fire woocommerce_empty_price_html

Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.

  1. WooCommerce icon WooCommerce7+ million installs apply_filters( 'woocommerce_empty_price_html', '', $this ) includes/abstracts/abstract-wc-product.php:2142
  2. Product Table & List Builder for WooCommerce icon Product Table & List Builder for WooCommerce10,000+ installs apply_filters( 'woocommerce_empty_price_html', wcpt_price($regular_price), $product ) templates/regular_price.php:25
  3. Payment Gateway for PayPal Pro, PayPal Checkout & Subscriptions for WooCommerce icon Payment Gateway for PayPal Pro, PayPal Checkout & Subscriptions for WooCommerce1,000+ installs apply_filters( 'woocommerce_empty_price_html', '', $this ) subscription/class-wcppprog-sub-product.php:133
  4. Multi Currency, Currency Switcher, Exchange Rates for WooCommerce icon Multi Currency, Currency Switcher, Exchange Rates for WooCommerce1,000+ installs apply_filters( 'woocommerce_empty_price_html', '', $variation ) lib/Price_Manager.php:72
  5. FooSales icon FooSales700+ installs apply_filters( 'woocommerce_empty_price_html', '', $wc_product ) admin/helpers/foosales-api-helper.php:218
  6. PeachPay icon PeachPay300+ installs apply_filters( 'woocommerce_empty_price_html', '', $product ) core/util/product.php:200
  7. GIFT4U icon GIFT4U200+ installs apply_filters( 'woocommerce_empty_price_html', '', $this ) inc/classes/g4u-product-giftcard.php:118
  8. StellarPay icon StellarPay200+ installs apply_filters( 'woocommerce_empty_price_html', '', $this ) src/Integrations/WooCommerce/Models/ProductTypes/Traits/WooCommerceProductClassUtilities.php:48
  9. BlueSnap Payment Gateway for WooCommerce icon BlueSnap Payment Gateway for WooCommerce90+ installs apply_filters( 'woocommerce_empty_price_html', '', $product ) includes/class-wc-bluesnap-multicurrency.php:727
  10. REES icon REES60+ installs apply_filters( 'woocommerce_empty_price_html', '', $this ) inc/models/rees-product-real-estate.php:209
  11. Pars Kit icon Pars Kit60+ installs apply_filters( 'woocommerce_empty_price_html', '', $product ) includes/Modules/Catalog/OutOfStockPrice.php:126
  12. User Post Collections icon User Post Collections20+ installs apply_filters( 'woocommerce_empty_price_html', '', $this ) controllers/mg-upc-woocommerce.php:618
  13. OpenGraphiq Lite icon OpenGraphiq Lite20+ installs apply_filters( 'woocommerce_empty_price_html', '', $product ) admin/class-opengraphiq-admin.php:1077
  14. TABLEiT icon TABLEiT20+ installs apply_filters( 'woocommerce_empty_price_html', '', $product ) templates/regular_price.php:19
  15. Cryptocurrency Product for WooCommerce icon Cryptocurrency Product for WooCommerce10+ installs apply_filters( 'woocommerce_empty_price_html', '', $product ) cryptocurrency-product-for-woocommerce.php:838
  16. Albums WooCommerce Plugin icon Albums WooCommerce Plugin10+ installs apply_filters( 'woocommerce_empty_price_html', '', $this ) includes/core/class-post-type.php:68
  17. CartNudge icon CartNudgeFewer than 10 installs apply_filters( 'woocommerce_empty_price_html', '', $product ) includes/helpers/cartnudge-functions.php:278
  18. Project Donations for WooCommerce icon Project Donations for WooCommerceFewer than 10 installs apply_filters( 'woocommerce_empty_price_html', '', $product ) includes/class-woocommerce.php:522

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.