How to remove WooCommerce checkout fields

The checkout is one of the most important steps in any eCommerce store. If you want to be successful and boost your sales, you need to keep it lean. That’s why today we’ll show you how to remove WooCommerce checkout fields. 

Some days ago, we gave you some tips on how to optimize your site. However, the last step of the purchase funnel is crucial to close the sale so it needs special attention. More than 75% of users add a product to the cart but then leave the website without buying anything (aka shopping cart abandonment). To avoid this, it’s extremely important that the checkout page is simple. As a result, you should only show the customers the fields that are absolutely necessary and eliminate every single distraction. 

It’s important to note that WooCommerce default checkout fields cannot be removed from the WordPress dashboard. In this tutorial, we’ll look at how to remove them in two different ways: 

  1. Using a plugin
  2. With a PHP script

Using a plugin is the easiest way if you’re not a developer. The PHP script, on the other hand, allows you to remove any existing checkout fields and customize your WooCommerce store with a bit of coding.

There’s no better or worse method. You’ll get the same result with both of them so depending on your skills, you can choose the one that best suits you.

1) Remove WooCommerce checkout fields using a plugin

The best tool to remove checkout fields is WooCommerce Checkout Manager, a free plugin that you can download from the official WordPress repository.

To remove any of the WooCommerce checkout fields simply follow these steps:

  1. Install and activate WooCommerce Checkout Manager
  2. Go to WooCommerce tab in your WP dashboard
  3. Click on Checkout and then on the Billing tab
  4. You’ll see a list of all the fields so just activate the disable option on the field you want to remove

Short and sweet, wasn’t it? This plugin also lets you add new fields, make fields optional or required, change the order in which fields are displayed, apply conditional logic, among other features.

If you want something quick and straightforward, this is the easiest way to remove WooCommerce checkout fields and optimize your store.

The main con that this method has is that when we install a plugin, we’re modifying the code of our website. This increases the complexity of it and the chances of breaking something. As a result, a customized script could be a good method if you’re comfortable with writing a few lines of code.

2) Remove WooCommerce checkout fields with PHP script

If you’ve checked our tutorial on how to edit WooCommerce checkout fields, you’ll be familiar with hooks. In this case, we will use the woocommerce_checkout_fields hook and we’ll call it quadlayers_remove_checkout_fields as follows:

add_filter( 'woocommerce_checkout_fields' , ' quadlayers_remove_checkout_fields ' );

This is a type of filter hook, which means that it must return something when we execute it. And what we are going to return? The data with the fields we want to remove.

For example, if we want to delete the last name field, we can use the following:

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

After that, we need to insert it into a function with the same name we’ve used in our filter hook in the first step (quadlayers_remove_checkout_fields):

function quadlayers_remove_checkout_fields( $fields ) {  

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

return $fields;  

}

Finally, the full script to remove the WooCommerce field last name must be inserted in a functions.php file of a child theme as shown below:

add_filter( 'woocommerce_checkout_fields' , ' quadlayers_remove_checkout_fields ' ); 

function quadlayers_remove_checkout_fields( $fields ) { 

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

return $fields; 

}

If you want to delete any other field, you just need to add the corresponding line. Below you can find available names of fields that you can remove:

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

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

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

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

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

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

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_email']);

unset($fields['account']['account_username']);

unset($fields['account']['account_password']);

unset($fields['account']['account_password-2']);

Conclusion

In conclusion, your checkout page can have a huge impact on your business and give you a competitive advantage. Therefore, it’s key to optimize it and improve it as much as you can.

In this tutorial, we’ve seen two different ways to remove WooCommerce checkout fields. Each of them has its own pros and cons so you should choose the one that best suits your skills and needs.

WooCommerce Checkout Manager is a plugin that allows you to delete fields in a fast an easy way. However, it makes the code of the store more complex.

The PHP function, on the other hand, requires some coding but it’s cleaner and won’t consume any resources.

Which method did you choose? Do you know any other way to remove WooCommerce checkout fields? Leave a comment below and share your experiences with us.