Categories

Featured templates

WooCommerce. How to remove checkout fields

Guillaume Dumas September 28, 2015
Rating: 5.0/5. From 5 votes.
Please wait...

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
This entry was posted in WooCommerce Tutorials and tagged checkout, field, WooCommerce. Bookmark the permalink.

Submit a ticket

If you are still unable to find a sufficient tutorial regarding your issue please use the following link to submit a request to our technical support team. We'll provide you with our help and assistance within next 24 hours: Submit a ticket