How to Remove Fields from Woocommerce Edit Address Form

To remove the country field from the checkout and “edit my address” pages, you have to remember to remove it not only from the billing address but the shipping address as well. Here is the example code to accomplish this. Paste the below code into functions.php of your current theme and it should work perfect.

add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' );
add_filter( 'woocommerce_billing_fields' , 'custom_override_billing_fields' );
add_filter( 'woocommerce_shipping_fields' , 'custom_override_shipping_fields' );

function custom_override_checkout_fields( $fields ) {
  unset($fields['billing']['billing_country']);
  unset($fields['shipping']['shipping_country']);
  return $fields;
}

function custom_override_billing_fields( $fields ) {
  unset($fields['billing_country']);
  return $fields;
}

function custom_override_shipping_fields( $fields ) {
  unset($fields['shipping_country']);
  return $fields;
}

Now you can alter the above code to fit your needs. Some of the field names you may want to remove include:
billing_first_name
billing_last_name
billing_email
billing_phone

4 Replies to “How to Remove Fields from Woocommerce Edit Address Form”

Leave a Reply

Your email address will not be published. Required fields are marked *