WordPress filter hook

woocommerce_checkout_required_field_notice

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

How to use woocommerce_checkout_required_field_notice

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

functions.php
add_filter( 'woocommerce_checkout_required_field_notice', function( $sprintf, $field_label, $key ) {
	// Change $sprintf here.
	return $sprintf;
}, 10, 3 );

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

11 plugins that fire woocommerce_checkout_required_field_notice

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_checkout_required_field_notice', sprintf( __( '%s is a required field.', 'woocommerce' ), '<strong>' . esc_html( $field_label ) . '</strong>' ), $field_label, $key ) includes/class-wc-checkout.php:1037
  2. Checkout Field Editor for WooCommerce icon Checkout Field Editor for WooCommerce20,000+ installs apply_filters( 'woocommerce_checkout_required_field_notice', sprintf( __( '%s is a required field.', 'woocommerce' ), '<strong>' . esc_html( $field_label ) . '</strong>' ), $field_label ) includes/class-awcfe-front-end.php:1061
  3. WC Fields Factory icon WC Fields Factory7,000+ installs apply_filters( 'woocommerce_checkout_required_field_notice', $msg, $field["label"] ) includes/wcff_checkout_fields.php:622
  4. Ubigeo de Perú para Woocommerce y WordPress icon Ubigeo de Perú para Woocommerce y WordPress4,000+ installs apply_filters( 'woocommerce_checkout_required_field_notice', $message, 'billing_departamento' ) rt_ubigeo_checkout.php:423
  5. MultiStep Checkout for WooCommerce icon MultiStep Checkout for WooCommerce3,000+ installs apply_filters( 'woocommerce_checkout_required_field_notice', sprintf( __( '%s is a required field.', 'woocommerce' ), '<strong>' . esc_html( $field_label ) . '</strong>' ), $field_label ) classes/class-thwmscf-settings.php:2306
  6. Sezzle Woocommerce Payment icon Sezzle Woocommerce Payment1,000+ installs apply_filters( 'woocommerce_checkout_required_field_notice', sprintf( __( '%s is a required field.', 'woocommerce' ), '<strong>' . esc_html( $field_label ) . '</strong>' ), $field_label, $key ) includes/class-sezzle-checkout.php:535
  7. CommerceBird icon CommerceBird400+ installs apply_filters( 'woocommerce_checkout_required_field_notice', sprintf( __( '%s is a required field.', 'woocommerce-b2b' ), '<strong>' . esc_html( $field_label ) . '</strong>' ), $field_label ) vendor-prefixed/woocommerce-b2b/includes/classes/class-wcb2b-frontend-myaccount.php:567
  8. Synchrony Financing icon Synchrony Financing90+ installs apply_filters( 'woocommerce_checkout_required_field_notice', sprintf( __( '%s is a required field.', 'woocommerce' ), self::OPEN_STRONG . esc_html( $field_label ) . self::CLOSE_STRONG ), $field_label, $fieldset_key ) src/gateway/class-synchrony-custom-order.php:774
  9. Confirm Shipping Address Before Order icon Confirm Shipping Address Before Order20+ installs apply_filters( 'woocommerce_checkout_required_field_notice', sprintf(__('%s is a required field.', 'wc-confirm-shipping-address-before-placing-order'), '<strong>' . esc_html($field_label) . '</strong>'), $field_label, $key ) wc-confirm-shipping-address-before-placing-order.php:189
  10. Cryptocurrency Product for WooCommerce icon Cryptocurrency Product for WooCommerce10+ installs apply_filters( 'woocommerce_checkout_required_field_notice', sprintf( __( '%s is a required field.', 'woocommerce' ), '<strong>' . esc_html( $field_label ) . '</strong>' ), $field_label, $key ) cryptocurrency-product-for-woocommerce.eth.php:2856
  11. StepraEngine Lite icon StepraEngine LiteFewer than 10 installs apply_filters( 'woocommerce_checkout_required_field_notice', sprintf( __( '%s is a required field.', 'stepraengine-lite' ), '<strong>' . esc_html( $field_label ) . '</strong>' ), $field_label, $key ) includes/woocommerce/class-stepra-wc-validation.php:394

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.