How to Manually Remove Checkout Billing Fields in WooCommerce

>How to Manually Remove Checkout Billing Fields in WooCommerce
  • form

As you might already know, WooCommerce doesn’t come with a feature that lets you customize the checkout page.

So the normal step would be to start looking for a plugin, right?

But if it’s something simple, which can be done manually, like removing some billing fields from the WooCommerce checkout page, then why use yet another plugin?

Adding another plugin means more code, more scripts, more bloat that can drag down your site’s performance!

I always say that the fewer plugins you have, the better!

So, in this post, we’re not going to use a plugin. No, sir! Instead, I’ll show you how to add some simple code in order to remove whatever billing fields you want from the WooCommerce checkout page.

I strongly recommend having a child theme in place, and also back up the functions.php file or the entire website before applying the code.

How to remove WooCommerce billing fields

To remove the billing fields in the WooCommerce checkout page, you’ll need to access your WordPress website’s files.

Once there, you need to locate the functions.php file in your child theme, usually found in /public_html/wp-content/themes/YOURTHEMENAME-child/functions.php

After that, you need to edit it and add the code, depending on what billing fields you want to remove from the checkout page.

Here is the list of billing fields that WooCommerce uses:

  • billing_first_name
  • billing_last_name
  • billing_company
  • billing_address_1
  • billing_address_2
  • billing_city
  • billing_postcode
  • billing_country
  • billing_state
  • billing_email
  • billing_phone

Now let’s say that you want to remove the “Postcode”, “State”, and “Phone” billing fields.

For that, you’ll have to add the following code in the functions.php file, right after whatever code is already there.

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

Here’s how it looks on our theme, Avada (this is an affiliate link):

Remove checkout billing fields WooCommerce

Now those three billing fields are gone from the WooCommerce checkout page.

Add more fields for removal

If you want to remove more fields later, all you need to do is to add another “unset” row, but with a different billing field.

Let’s say you’ll also want to remove the “Country” field.

All you have to do is to add this to the code: unset($fields['billing']['billing_country']);

And the code will look like this:

add_filter( 'woocommerce_checkout_fields' , 'custom_checkout_fields' );
function custom_checkout_fields( $fields ) {
unset($fields['billing']['billing_postcode']);
unset($fields['billing']['billing_state']);
unset($fields['billing']['billing_phone']);
unset($fields['billing']['billing_country']);
return $fields;
}

Save the file and clear your caches

Don’t forget to save the file and also clear your cache from both your website and browser, if the changes don’t seem to take effect after just simply refreshing the checkout page.

You might also want to read:

That’s a wrap

Hope you found the guide comprehensive and helped you remove the billing fields from the WooCommerce checkout page.

Don’t forget to share and help your friends out too!

If you have questions or something to say, please drop a comment, contact us, or message on Facebook.

You can also follow us on Twitter and subscribe to our YouTube channel.

If you want to start your own WordPress blog, or need a website for your business, our WordPress services are at your disposal!

WP Rocket - WordPress Caching Plugin
By |2018-08-22T14:29:34+00:00March 21st, 2018|Customization, Plugins|0 Comments

Leave A Comment

SUBSCRIBE BEFORE YOU GO?

- Get guides and offers right into your inbox -

The type of emails that you would like to receive (multiple selection allowed):

You can unsubscribe at any time by clicking the link in the footer of the emails. For more information, please check the privacy policy.

I use MailChimp as my emailing service. By subscribing, you understand that your email and preferences will be transferred to MailChimp. Learn more about MailChimp's privacy practices here.

close-link