How to Remove WooCommerce Billing Fields

Remove WooCommerce billing fields

Hello friends, Good Morning!
Today, we are going to learn a WooCommerce trick. This trick is about how to remove WooCommerce billing fields. I want to tell you that WooCommerce is a very powerful WordPress tool that converts a simple website into an E-commerce one. Nowadays, if we look at the current stats, WooCommerce has been downloaded 73,299,254 times. Even more impressive, WooCommerce powers 28% of all online stores worldwide.

WooCommerce, the most customizable eCommerce plateform for building your online business.

A few days back, one of my friends asked me a question regarding WooCommerce about how to remove the billing field from the checkout page. He didn’t mention any field, but today we will show how to remove WooCommerce billing fields. So, let’s start

There are two ways to remove WooCommerce billing fields on the checkout page. Below they are:

  1. Add the below snippet to the functions.php file of your website’s active theme.
  2. Install the WooCommerce Checkout Field Editor plugin for more customization.

Adding the below snippet is risky if you do it directly from the WordPress Dashboard. We highly recommend that you do this from either FileZilla(File Transfer Protocol) or through cPanel. What you have to do this to log in to CPanel or Connect FTP, Open the wp-contents folder >> Themes >> theme name Child >> functions.php. Here is the snippet to remove WooCommerce billing fields.

add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_woofields' );
function custom_override_checkout_woofields( $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;
}

Here is another example: if you want to remove any specific billing field, let’s suppose Company Name, then your snippet would look like this:

add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' );

function custom_override_checkout_fields( $fields ) {
    unset($fields['billing']['billing_phone']);
    return $fields;
}

So friends, finally, a few lines of code and you can easily remove any WooCommerce billing field from the checkout page.

Friends, if this WooCommerce tip&trick helps you, then please let me know in the comments box, and please don’t forget to share this. Keep learning.


Discover more from Wordpress Tutorial for Beginner's

Subscribe to get the latest posts sent to your email.

Share:

Facebook
Twitter
Pinterest
LinkedIn

Please share your thought

Discover more from Wordpress Tutorial for Beginner's

Subscribe now to keep reading and get access to the full archive.

Continue reading