How to Hide Company Name Field WooCommerce Checkout Page

WooCommerce Hide Company Name Field From the WooCommerce Checkout PageWooCommerce has more than 5 million active installations in the WordPress community, and this number continues to rise because WooCommerce is flexible for customization. In this post, you will see how you can hide the Company Name field from the WooCommerce Checkout page.

WooCommerce Hide Company Name Field Checkout Page

There are many reasons why you may want to hide the Company Name field from the WooCommerce Checkout.

One of the situations that may force you to hide this field is selling to consumers rather than businesses. If you own a consumer-focused WooCommerce store, having the company name field is just added friction on your Checkout. This could potentially confuse customers if they are not sure whether it needs to be filled out or not.

From an expert’s perspective, you need to optimize your Checkout page. You can do this by removing unnecessary fields on this page. This means that users will not take a long time to finalize an order.

Steps to Hide the Company Name Field from the Checkout Page

However, it is very easy to hide the Company Name field from the WooCommerce Checkout. In this section, we will use a custom PHP script that I have created. Moreover, I will illustrate how you can implement this solution on your WooCommerce store, using the Storefront theme.

Here is how the Company Name field is displayed on the checkout page:Company name field on the checkout page

Here are the steps that you need to follow:

  1. Log into your WordPress site and access the Dashboard as the admin user.
  2. From the Dashboard menu, click on Appearance Menu > Theme Editor Menu. When the Theme Editor page is opened, look for the theme functions file to rename the address tab on the My Accounts page.
  3. Click anywhere on the text editor and scroll to the bottom of the functions.php file. Paste the code at the end:
/**

* @ snippet         Hide the Company Name Field from the Checkout Page

*/

add_filter( 'woocommerce_checkout_fields' , 'remove_company_name' );

function remove_company_name( $fields ) {

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

     return $fields;

}
  1. Click on the Save changes button at the bottom of the text editor screen.
  2. You have successfully added the code snippet required to hide the Company Name field on the Checkout page. This will be the outcome on the front end:WooCommerce hide the company name checkout field on the checkout page

How the Code Works

WooCommerce makes it easy to customize the Checkout by using hooks and filters. To hide the Company name field, I used the woocommerce_checkout_fields hook and then applied a filter to unset the [billing] [billing_company] field from the array returned.

Conclusion

In summary, this post shares how you can hide the Company Name field on the WooCommerce Checkout page. However, I highly recommend using a child theme to follow the steps that I have shared. If you do not have a child theme, please create one.

Before making changes to your PHP file, take a backup. You can either copy and paste the contents into an empty notepad document or download a copy from cPanel File Manager if you know how to do this. If you are not familiar with handling code, I recommend that you hire a qualified WordPress developer.

Similar Articles