Remove WooCommerce Billing Address Fields
WooCommerce is by far one of the most user-friendly solutions for selling products or services via your WordPress website. The free plugin allows you to accept Payments, track Invetory, run Marketing Campagigns and generate performance Reports.
Before we dive in please checkout this sponsored list of Alternatives for WordPress
Remove Billing Address Fields
While the out-of-the-box solution is perfect for many there may be some users like myself who require a little customization to make the checkout process a little easier. On the Checkout page users are required to fill in several Billing address fileds which is not so bad for many users especially those selling tangible products.
// REMOVE BILLING FIELDS --WooCommerce
add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' );
function custom_override_checkout_fields( $fields ) {
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_address_2']);
unset($fields['billing']['billing_postcode']);
unset($fields['billing']['billing_company']);
unset($fields['billing']['billing_last_name']);
unset($fields['billing']['billing_email']);
unset($fields['billing']['billing_city']);
return $fields;
}
Remove Headings
After removing all the Billing fields and associated labels we’re left with 2 more labels “Billing Address” and “Additional Information”. These labels/headings can be removed or edited by:
- Navigate to the woocommerce folder inside of your wordpress theme directory (eg: /wp-content/themes/mytheme/woocommerce)
- Go into the woocommerce/templates/checkout/form-billing.php template file, scroll to Line 19 and replace label with “” OR whatever label you prefer.
- Next, locate the form-shipping.php template file inside the smae folder, scroll to Line 55 and replace the label accordingly.
- That’s It! Refresh the cart page to see the difference.
WooCommerce Documentation
For a full documentation on editing or removing woocommerce fields and labels goto Removing WooCommerce Fields
Join the Newsletter
Sign up for our personalized daily newsletter
-
John
-
epicallyfun
-
-
epicallyfun