WordPress filter hook

woocommerce_admin_shipping_fields

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

“Provides an opportunity to modify the list of order shipping fields displayed on the admin.”

How to use woocommerce_admin_shipping_fields

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:

functions.php
add_filter( 'woocommerce_admin_shipping_fields', function( $value ) {
	// Change $value here.
	return $value;
}, 10, 1 );

Argument names come from GLS Click&Ship (Denmark)'s source. Other plugins may pass different values: check the call in the plugin you're targeting below.

8 plugins that fire woocommerce_admin_shipping_fields

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_admin_shipping_fields', array( 'first_name' => array( 'label' => __( 'First name', 'woocommerce' ), 'show' => false, ), 'last_name' => array( 'label' => __( 'Last name', 'woocommerce' ), 'show' => false, ), 'company' => array( 'label' => __( 'Company', 'woocommerce' ), 'show' => false, ), 'address_1' => array( 'label' => __( 'Address line 1', 'woocommerce' ), 'show' => false, ), 'address_2' => array( 'label' => __( 'A... ) includes/admin/meta-boxes/class-wc-meta-box-order-data.php:127
  2. WCFM icon WCFM10,000+ installs apply_filters( 'woocommerce_admin_shipping_fields', array( 'first_name' => array( 'label' => __( 'First Name', 'woocommerce' ), 'show' => false, ), 'last_name' => array( 'label' => __( 'Last Name', 'woocommerce' ), 'show' => false, ), 'company' => array( 'label' => __( 'Company', 'woocommerce' ), 'show' => false, ), 'address_1' => array( 'label' => __( 'Address 1', 'woocommerce' ), 'show' => false, ), 'address_2' => array( 'label' => __( 'Addres... ) core/class-wcfm-library.php:1767
  3. AliNext icon AliNext4,000+ installs apply_filters( 'woocommerce_admin_shipping_fields', [ 'first_name' => array( 'label' => esc_html__( 'First name', 'woocommerce' ), 'show' => false, ), 'last_name' => array( 'label' => esc_html__( 'Last name', 'woocommerce' ), 'show' => false, ), 'company' => array( 'label' => esc_html__( 'Company', 'woocommerce' ), 'show' => false, ), 'address_1' => array( 'label' => esc_html__( 'Address line 1', 'woocommerce' ), 'show' => false, ), 'address_2' ... ) includes/classes/controller/OrderFulfillmentController.php:107
  4. bpost-shipping-platform icon bpost-shipping-platform500+ installs apply_filters( 'woocommerce_admin_shipping_fields', array( 'first_name' => array( 'label' => esc_html__('First name', 'bpost-shipping-platform'), 'show' => false, ), 'last_name' => array( 'label' => esc_html__('Last name', 'bpost-shipping-platform'), 'show' => false, ), 'company' => array( 'label' => esc_html__('Company', 'bpost-shipping-platform'), 'show' => false, ), 'address_1' => array( 'label' => esc_html__('Address line 1', 'bpost-shipping... ) includes/class-woo-Bpost-order.php:1313
  5. WooCommerce PayPal Here Payment Gateway icon WooCommerce PayPal Here Payment Gateway100+ installs apply_filters( 'woocommerce_admin_shipping_fields', array( 'first_name' => array( 'label' => __( 'First name', 'woocommerce-gateway-paypal-here' ), 'show' => false, ), 'last_name' => array( 'label' => __( 'Last name', 'woocommerce-gateway-paypal-here' ), 'show' => false, ), 'company' => array( 'label' => __( 'Company', 'woocommerce-gateway-paypal-here' ), 'show' => false, ), 'address_1' => array( 'label' => __( 'Address line 1', 'woocommerce-gat... ) includes/Admin/Meta_Boxes/Order_Data.php:487
  6. Shiptimize for WooCommerce icon Shiptimize for WooCommerce100+ installs apply_filters( 'woocommerce_admin_shipping_fields', array( 'first_name' => array( 'label' => __( 'First name', 'woocommerce' ), 'show' => false, ), 'last_name' => array( 'label' => __( 'Last name', 'woocommerce' ), 'show' => false, ), 'company' => array( 'label' => __( 'Company', 'woocommerce' ), 'show' => false, ), 'address_1' => array( 'label' => __( 'Address line 1', 'woocommerce' ), 'show' => false, ), 'address_2' => array( 'label' => __( 'A... ) includes/class-woo-shiptimize-order.php:1273
  7. GLS Click&Ship (Denmark) icon GLS Click&Ship (Denmark)100+ installs apply_filters( 'woocommerce_admin_shipping_fields', array( 'first_name' => array( 'label' => $GLSDk->translate( 'First name' ), 'show' => false, ), 'last_name' => array( 'label' => $GLSDk->translate( 'Last name' ), 'show' => false, ), 'company' => array( 'label' => $GLSDk->translate( 'Company' ), 'show' => false, ), 'address_1' => array( 'label' => $GLSDk->translate( 'Address line 1' ), 'show' => false, ), 'address_2' => array( 'label' => $GLSDk... ) includes/class-woo-GLSDk-order.php:1280
  8. Invoice management for Woocommerce icon Invoice management for WoocommerceFewer than 10 installs apply_filters( 'woocommerce_admin_shipping_fields', array( 'first_name' => array( 'label' => __( 'First name', 'woocommerce' ), 'show' => false, ), 'last_name' => array( 'label' => __( 'Last name', 'woocommerce' ), 'show' => false, ), 'company' => array( 'label' => __( 'Company', 'woocommerce' ), 'show' => false, ), 'address_1' => array( 'label' => __( 'Address line 1', 'woocommerce' ), 'show' => false, ), 'address_2' => array( 'label' => __( 'A... ) admin/meta-boxes/class-wc-meta-box-order-data.php:93

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.