Bookmark

No account yet? Register

Difficulty: Easy

Here we will cover how to remove certain or all fields from your checkout page in your Woocommerce store. Removing checkout fields is very simple and can be done like many other things on your WooCommerce store by adding code to your Functions.php file in your theme folder.

TLDR
File: Functions.php

// Remove checkout fields
add_filter( 'woocommerce_checkout_fields' , 'remove_checkout_fields' );

function remove_checkout_fields( $fields ) {
 // remove billing fields
    unset($fields['billing']['billing_first_name']); // Billing First name
    unset($fields['billing']['billing_last_name']); // Billing Last name
    unset($fields['billing']['billing_company']); // Billing company
    unset($fields['billing']['billing_address_1']); // Billing Address 1
    unset($fields['billing']['billing_address_2']); // Billing Address 2
    unset($fields['billing']['billing_city']); // Billing city
    unset($fields['billing']['billing_postcode']); // Billing postcode
    unset($fields['billing']['billing_country']); // Billing country
    unset($fields['billing']['billing_state']); // Billing state
    unset($fields['billing']['billing_phone']); // Billing phone
    unset($fields['billing']['billing_email']); // Billing email
   
    // remove shipping fields 
    unset($fields['shipping']['shipping_first_name']); // Shipping first name  
    unset($fields['shipping']['shipping_last_name']); // Shipping last name  
    unset($fields['shipping']['shipping_company']); // Shipping company  
    unset($fields['shipping']['shipping_address_1']); // Shipping address 1
    unset($fields['shipping']['shipping_address_2']); // Shipping address 2
    unset($fields['shipping']['shipping_city']); // Shipping city 
    unset($fields['shipping']['shipping_postcode']); // Shipping postcode
    unset($fields['shipping']['shipping_country']); // Shipping country
    unset($fields['shipping']['shipping_state']); // Shipping state
    
    // remove order comment fields
    unset($fields['order']['order_comments']); // Order comments
     return $fields;
}

Removing Woocommerce checkout fields

Customizing functions.php file in WordPress

To remove checkout fields from your checkout page first navigate to your admin interface and then go to Appearance and then under Appearance select Theme Editor.

After navigating there you will see a window like this one below. In there select Theme Functions (functions.php) and then at the end put this code. Delete the lines of code that include the fields you don’t want to remove. For example if you would like to keep the field “First Name” in your checkout page you would remove the line of code where it says “unset($fields[‘billing’][‘billing_first_name’]); // Billing First name“.

// Remove checkout fields
add_filter( 'woocommerce_checkout_fields' , 'remove_checkout_fields' );

function remove_checkout_fields( $fields ) {
 // remove billing fields
    unset($fields['billing']['billing_first_name']); // Billing First name
    unset($fields['billing']['billing_last_name']); // Billing Last name
    unset($fields['billing']['billing_company']); // Billing company
    unset($fields['billing']['billing_address_1']); // Billing Address 1
    unset($fields['billing']['billing_address_2']); // Billing Address 2
    unset($fields['billing']['billing_city']); // Billing city
    unset($fields['billing']['billing_postcode']); // Billing postcode
    unset($fields['billing']['billing_country']); // Billing country
    unset($fields['billing']['billing_state']); // Billing state
    unset($fields['billing']['billing_phone']); // Billing phone
    unset($fields['billing']['billing_email']); // Billing email
   
    // remove shipping fields 
    unset($fields['shipping']['shipping_first_name']); // Shipping first name  
    unset($fields['shipping']['shipping_last_name']); // Shipping last name  
    unset($fields['shipping']['shipping_company']); // Shipping company  
    unset($fields['shipping']['shipping_address_1']); // Shipping address 1
    unset($fields['shipping']['shipping_address_2']); // Shipping address 2
    unset($fields['shipping']['shipping_city']); // Shipping city 
    unset($fields['shipping']['shipping_postcode']); // Shipping postcode
    unset($fields['shipping']['shipping_country']); // Shipping country
    unset($fields['shipping']['shipping_state']); // Shipping state
    
    // remove order comment fields
    unset($fields['order']['order_comments']); // Order comments
     return $fields;
}
This image has an empty alt attribute; its file name is image-1-1024x483.png

Click on button bellow to update your file/save changes and that’s it. Now your WooCommerce checkout page will have the fields you desire.