WooCommerce Checkout Fields Remover

Generate the woocommerce_checkout_fields snippet that removes, relabels or makes optional the checkout fields your store does not need.

Live output

Enable JavaScript to customise; default output below.

Fields to remove

Removed fields are not collected at all. Anything a payment gateway needs will fail without it.

Fields to make optional

Safer than removing. The field is still there, still stored, just not required.

Live preview checkout-fields.php
<?php
/**
 * Checkout field changes.
 */

/**
 * Removes, relabels and relaxes checkout fields.
 *
 * @param array $fields Checkout fields, grouped by section.
 * @return array
 */
function my_store_checkout_fields( $fields ) {
	unset( $fields['billing']['billing_company'] );
	unset( $fields['billing']['billing_address_2'] );

	if ( isset( $fields['order']['order_comments'] ) ) {
		$fields['order']['order_comments']['label']       = __( 'Delivery instructions', 'my-store' );
		$fields['order']['order_comments']['placeholder'] = __( 'Gate code, safe place, anything the driver should know.', 'my-store' );
	}

	return $fields;
}
add_filter( 'woocommerce_checkout_fields', 'my_store_checkout_fields' );

/**
 * Applies the same changes to the saved address forms.
 *
 * The checkout filter does not touch My Account, Addresses, or the address
 * fields in the admin order editor. This one does.
 *
 * @param array $fields Address fields.
 * @return array
 */
function my_store_address_fields( $fields ) {
	unset( $fields['company'] );
	unset( $fields['address_2'] );

	return $fields;
}
add_filter( 'woocommerce_default_address_fields', 'my_store_address_fields' );

Output is valid and updates as you type.

Tick the checkout fields your store does not need and the generator writes the woocommerce_checkout_fields snippet, including the second filter that stops the fields reappearing in My Account.

How to use

  1. Prefer making a field optional over removing it. An optional field still collects the value when a customer wants to give it, and nothing downstream breaks.
  2. Check your payment gateway before removing the phone number. Several require it, and the failure shows up as a declined payment, not a validation message.
  3. Leave the address book option on. woocommerce_checkout_fields only changes checkout; saved addresses and the admin order editor use a different filter.
  4. Relabel the order notes field rather than deleting it if the problem is the wording. “Order notes” means nothing to most shoppers.
  5. Put the snippet in a site specific plugin, not in the theme. Checkout should survive a theme change.

Example

Company and second address line gone, phone made optional, order notes relabelled:

function acme_checkout_fields( $fields ) {
	unset( $fields['billing']['billing_company'] );
	unset( $fields['billing']['billing_address_2'] );

	$fields['billing']['billing_phone']['required'] = false;

	if ( isset( $fields['order']['order_comments'] ) ) {
		$fields['order']['order_comments']['label'] = __( 'Delivery instructions', 'acme' );
	}

	return $fields;
}
add_filter( 'woocommerce_checkout_fields', 'acme_checkout_fields' );

The second filter, woocommerce_default_address_fields, is what keeps those fields out of My Account and the admin order screen.

Pitfalls

  • Removing a field does not remove the data already stored against past orders. It stops new orders collecting it.
  • woocommerce_checkout_fields only affects the checkout form. Saved addresses, the admin order editor and the shortcode address form use woocommerce_default_address_fields.
  • Some gateways require a phone number or a full address. Removing the field gives you a gateway error at payment, long after the customer filled the form in.
  • Unsetting a field that a plugin added later runs before that plugin. Use a later filter priority when a field refuses to disappear.
  • The blocks based checkout does not use these filters. If your store uses the Checkout block, field changes go through its own settings or a block filter.
  • Making a field optional keeps validation off but leaves the field in the address format, so it still prints on the invoice when filled.
  • Country specific locales override these settings. A field can be required again for one country through woocommerce_get_country_locale.
  • Removing order_comments also removes the customer’s only free text route, which usually ends up as an email to support instead.

Compatibility

woocommerce_checkout_fields and woocommerce_default_address_fields have been stable since WooCommerce 2.x and still apply to the classic shortcode checkout in WooCommerce 8 and 9. The Checkout block, default since WooCommerce 8.3, ignores both. The generated code targets PHP 7.0 and up, and the tool runs entirely in your browser.

Frequently asked questions

Why is the field still there?
Either the store uses the Checkout block, or a plugin adds the field after your filter runs. Raise the priority and check the block setting.
Does removing a field delete old data?
No. Existing orders keep what they collected. Only new orders stop collecting it.
Can I remove the state or postcode field?
You can, but they drive tax and shipping calculations. Country locale rules will also add them back for some countries.
How do I make a field required instead?
Set ['required'] = true on it in the same filter. The generated snippet shows the pattern.
Where should this code live?
A site specific plugin or a code snippets plugin. In the theme’s functions.php it disappears the day the theme changes.

From the people who built this tool

WP Adminify

The WordPress admin, rebuilt: a dashboard worth looking at, menu and column control, a real file manager and the login page your client sees.

See WP Adminify Free version on WordPress.org

Weekly drops

New tools, when there are new tools

One email when something worth using ships. No schedule to fill, so no filler.

Your address goes nowhere else, and one click unsubscribes.