How To Remove The Company Name Field From The WooCommerce Checkout

WooCommerce is a fully-featured ecommerce system that comes with a lot out of the box. With zero alterations, it can power just about any store. Just add your products and choose how you’ll get paid and you’re done!

But what if you don’t want all those features? Luckily, everything within WordPress and Woocommerce is changeable. Some is easier to change than others, but still can be changed if you’re willing to add some code.

From some of my own e-commerce websites and clients’, we wanted to remove the company name input field from the Woocommerce checkout.

If you have a WordPress + Woocommerce website, this might be of interest to you. Not only does that field take up space and slow down the checkout process, it’s generally not needed, especially if most of your customers are regular users and are not a business.

There’s no checkbox to remove that field (or any fields) from the checkout form. So, how are you supposed to remove it?

Remove the Company Name field from Woocommerce checkout

I bet there are plugins you could download to customize the checkout form to remove the company name field, but that seems like overkill if you’re ok with working in some code then that’s what I’d suggest. Just be sure to make a backup of anything you change before you add anything. A backup can be as simple as just copy and paste the functions.php file from the editor to a text file.

1) Go to Appearance -> Editor

2) Then make sure you have the functions.php file selected to the right.

Yours will probably look different than ours. You might have a lot more files in yours – it’s there, you might have to scroll a bit to find.

3) Scroll to the bottom of the file, which happens to be line 218 for us.

4) Paste this code into the bottom, which would be on line 219.

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

With the new code, it should look something like this:

It’s not a whole lot of code so we definitely suggest going this route over other methods like a plugin. Plugins can hog resources on your website and we’d hate for your site to slow down and lose customers simply because you wanted to remove the company name field.

Leave a Reply

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