Remove Company Field from Billing Address in WooCommerce Checkout

In WooCommerce, the billing address form typically includes a “Company” field by default. However, in some cases, you may want to remove this field to simplify the checkout process. This post will guide you through the process of removing the company field from the billing address section in the WooCommerce checkout form.

/**
* Snippet Name:  Remove Company Field from Billing Form
* Snippet Author:  wpsnippets.dev
*/

//removing company field  from checkout form
function wps_remove_company_field($fields) {
    unset($fields['billing']['billing_company']);
    return $fields;
}
add_filter('woocommerce_checkout_fields', 'wps_remove_company_field');

Code Explanation

  • This code snippet uses the woocommerce_checkout_fields filter to modify the billing address fields array. It unsets the billing_company field, effectively removing it from the billing address section in the checkout form.

Leave a Comment

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

Scroll to Top