Delete / remove details from checkout in WooCommerce (Postal Code, Company, Phone …)

WooCommerce It is a very simple system for anyone who wants to create a Magazine online, having at the base WordPress.
When installing default, WooCommerce will add a standard form for billing details. On the page “Checkout”of the client.
Conceived as a system of Magazine online To allow both the delivery of physical products and the discharge of a virtual, WooCommerce requires in the standard form A series of customer data: name, first name, phone number, country, address, city, Cod Postal. Some of these fields are not necessary for a virtual command, for example. A product that can be downloaded or a product that has been paid through PayPal would not need the data for delivery. In this case it is good to ease the control system for the user, by eliminating some fields from checkout.

Elimination of the field “Cod Postal” din WooCommerce Checkout

We can eliminate “Postal code” / Billing postcode from WooCommerce, we must go and edit the functions.php file of the WordPress the website. In functions.php add the lines:

add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' );
function custom_override_checkout_fields( $fields ) {
unset($fields['billing']['billing_postcode']);
return $fields;
}

Where “billing_postcode” It is the field for the postcode. If we want to remove the second field of address, we will replace “billing_postcode” cu “billing_address_2”.

 unset($fields['billing']['billing_address_2']);

There are situations in which no detail of the customer's payment may not be interested. Usually when the payment is made through paypal. In this scenario we can choose to eliminate all the fields from the order page.

add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' );
function custom_override_checkout_fields( $fields ) {
unset($fields['billing']['billing_postcode']);
unset($fields['billing']['billing_country']);
unset($fields['billing']['billing_state']);
unset($fields['billing']['billing_phone']);
unset($fields['order']['order_comments']);
unset($fields['billing']['billing_address_2']);
unset($fields['billing']['billing_postcode']);
unset($fields['billing']['billing_company']);
unset($fields['billing']['billing_last_name']);
unset($fields['billing']['billing_email']);
unset($fields['billing']['billing_city']);
return $fields;
}

This way you will delete all Woocommerce checkout fields.

Passionate about technology, I write with pleasure on stealthsetts.com starting with 2006. I have a rich experience in operating systems: Macos, Windows and Linux, but also in programming languages ​​and blogging platforms (WordPress) and for online stores (WooCommerce, Magento, Presashop).

Home Your source of IT tutorials, useful tips and news. Delete / remove details from checkout in WooCommerce (Postal Code, Company, Phone …)

6 thoughts on “Delete / remove details from checkout in WooCommerce (Postal Code, Company, Phone …)”

  1. Hello thank you for this post!
    I needed to delete the name of the company and it's perfect it worked !!
    I also want to delete the name of the company on “ship to a different address”.
    But I don't know what to replace Custom_Override_Checkout_Fields in your code. Could you help me?

    Reply
  2. Hi,I added this code to functions.php as guided but my website crashed. It’s totally blank. I’m not totally new to stuff like this but i’m not a pro either.

    If i could access my dashboard, i would just erase it but i cannot access anything on my website at all.

    Please help, what should i do? Urgent response needed please!

    Reply
  3. Hello
    I am in the payment section ” Billing Information “writing “delivery address ” I want to change as. What can we do.

    Reply
    • Hello,
      Yes, is a good ideea in customizer but in the latest version of Woo I see only “address 2”, “company”. For postal code and oher fileds is req functions code to hide.

      Reply
Leave a Comment