Site icon PeterStavrou.com

WooCommerce: How To Easily Remove The Checkout Fields

If you are using WooCommerce for digital products then you obviously do not need all of the checkout fields (billing details) that are on the checkout page by default.

Seeing as multiple people have contacted me to fix their websites after following various guides on “How to remove the WooCommerce checkout fields”, I have decided to write a post on how to safely but very easily do this.

The thing is, all of these guides advise you to directly modify your functions.php file which I am highly against.
If you are not familiar with coding and you cluelessly follow their instructions there is a high chance that you will break your website.
Don’t believe me? Take a look at the user comments from these guides, I guarantee that there is at least one person that is upset because their website broke.

Below I’m going to show you the safest and quickest way to remove the checkout fields from WooCommerce and if you do make a mistake you can very easily undo the changes, unlike if you were to modify functions.php directly.

WooCommerce: How To Safely Remove The Checkout Fields

Simplify the WooCommerce checkout by removing billing fields

    1. 1. To remove the billing fields in the WooCommerce checkout page first install the plugin My Custom Functions.

This plugin allows you to easily and safely add functions, snippets or any custom code without directly editing your functions.php file.

The code entered in the plugin will run safely and will not generate any fatal errors, this means your website will not break if there is an error in your code.

Also, the custom code you add into the plugin will continue working, no matter how many times you update or switch your theme.

    1. 2. Once you have installed the plugin go to Appearances and then click on Custom Functions.

You will see a white text area where you can enter code.

    1. 3. To remove all of the checkout fields from WooCommerce, copy and paste the below code into the Custom Functions plugin.
/* WooCommerce: The Code Below Removes Checkout Fields */
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_email']);
unset($fields['account']['account_username']);
unset($fields['account']['account_password']);
unset($fields['account']['account_password-2']);
return $fields;
}
  1. 4. If you take a look at the code, you will notice that it is fairly easy to understand which checkout field each line represents

For example, the below code hides the fields:
– First Name
– Last Name
– Company

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

If you would like to display any checkout fields that have been removed, you can simply delete the line of code that represents the specific field.

That’s all there is to it! Simple, Fast and Safe!
If you encounter any errors you can simply remove the code from the Custom Functions plugin and your site will go back to how it was.


An amazing WordPress plugin to quickly and easily create beautiful, engaging and visually impressive landing pages that convert visitors into sales!

Disclosure: This page contains affiliate links. I have a strict policy to only promote products I personally use to run my business. If you decide to purchase a product through an affiliate link I will receive a commission at no extra cost to you. This is how I fund the blog – thanks for your support!

How To Remove The Additional Information Tab

You may be wondering how to remove the Additional Information tab on the single product page.
You can easily remove it by adding the below code into the Custom Functions plugin (underneath your existing code).

/* WooCommerce: The Code Below Removes The Additional Information Tab */
add_filter( 'woocommerce_product_tabs', 'woo_remove_product_tabs', 98 );
function woo_remove_product_tabs( $tabs ) {
unset( $tabs['additional_information'] );
return $tabs;
}

/* WooCommerce: The Code Below Removes The Additional Information Title Text */
add_filter('woocommerce_enable_order_notes_field', '__return_false');

How To Change Billing Details Text

If you want to change the “Billing details” text at the top of the checkout page you can use the below code which will change the text to “Shipping Details”.

/* WooCommerce: Change Billing details text to Shipping Details */
function wc_billing_field_strings( $translated_text, $text, $domain ) {
switch ( $translated_text ) {
case 'Billing details' :
$translated_text = __( 'Shipping Details', 'woocommerce' );
break;
}
return $translated_text;
}
add_filter( 'gettext', 'wc_billing_field_strings', 20, 3 );

To change the “Shipping Details” text to something else simply change the below line in the code.

$translated_text = __( 'Shipping Details', 'woocommerce' );

What did you think of this guide? Did you manage to safely remove the checkout fields from WooCommerce?

You may also be interested in…

Thrive Leads – The Best Popup Plugin for WordPress


If you are looking for the best WordPress popup plugin that allows you to create various types of opt-in forms to collect emails and quickly grow your mailing list then I cannot recommend Thrive Leads enough. Every opt-in form on my website has been created using Thrive Leads.

Exit mobile version