How to Remove Address Fields on Checkout in WooCommerce

How to Remove Address Fields on Checkout in WooCommerce

The Power of WordPress and WooCommerce is no need to say anymore. As you already know and using WooCommerce. Address Fields is a common option in the Checkout page in WooCommerce but if you sell a digital product then It’s no need to Address Fields on Checkout in WooCommerce.

In this tutorial, I am going to show you How to Remove Address Fields on Checkout in WooCommerce.

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_address_2']);
    unset($fields['billing']['billing_postcode']);
    unset($fields['billing']['billing_company']);
    unset($fields['billing']['billing_last_name']);
    unset($fields['billing']['billing_city']);
    return $fields;
}

Leave a Reply