If this tutorial is not what you were looking for, you still have any questions, suggestions or concerns - feel free to let us know. Please help us to serve you better!

Your Name

Your Email

Your Message (required)

captcha

Featured templates

WooCommerce. How to remove checkout fields

This tutorial shows you how to remove checkout fields in a WooCommerce store.

WooCommerce. How to remove checkout fields

Default WooCommerce checkout form comes with several fields for customers to enter their billing details. But in some cases, you might want to hide some of these fields. For example, if you are selling only virtual products, you can get rid of fields like billing address:

WooCommerce._How_to_remove_checkout_fields-1

In order to remove checkout fields, you need to perform the following:

  1. Open up the wp-content/themes/themeXXXXX/includes/custom-function.php file. You may need to download it to your local system if you are using FTP, or you can access the file directly through your hosting file manager.

  2. Scroll down to the very end of the file and add the following code there:

    <?php 
    
    add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' );
     
    function custom_override_checkout_fields( $fields ) {
    
        return $fields;
    }
    
    ?>
    
  3. Choose the fields to be removed from the list below and insert the corresponding code inside the custom_override_checkout_fields function before the return statement.

    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']);
    
    WooCommerce._How_to_remove_checkout_fields-2
  4. Save the changes in the wp-content/themes/themeXXXXX/includes/custom-function.php file and upload it to the server. Reload the page. The fields chosen to be unset are removed from the checkout page:

    WooCommerce._How_to_remove_checkout_fields-3

Feel free to check the detailed video tutorial below:

WooCommerce. How to remove checkout fields
  • Rostislav Sofronov

    Отлично, спасибо!

    No votes yet.
    Please wait...
  • Андрей

    Спасибо большое автор! Всё помогло!

    No votes yet.
    Please wait...
  • Lorenz Adam Damara

    Thanksssss, nice tutorial

    No votes yet.
    Please wait...
 
Live Chat
We help you to choose the right product.
Start chat