How to remove billing detail for logged in users in woocommerce checkout

In Woocommerce, When customer purchase a product, woocommerce add a form to enter his billing details. It’s Woocommerce default functionality but in some case many shop owner want get money from customer and send product , that’s all, no need to make customer enter any billing address information another way many shop owner want to remove billing details form from checkout page, when user is already logged. So how can you do this. We can achieve this by simple coding. Let’s have a look.

Here is default view of checkout page:

Here is after remove billing detail for logged in users view in woocommerce checkout page.

Add below code at the end of your theme’s functions.php file of your active child theme (or theme) and Save the file to remove billing address for logged in users in woocommerce checkout.

add_filter( 'woocommerce_checkout_fields' , 'hide_billing_detail_checkout' );
function hide_billing_detail_checkout( $fields ) {
    if( is_user_logged_in() ){
        unset($fields['billing']);
		$fields['billing'] = array();
    }
    return $fields;
}

If you want to remove billing detail for all user in woocommerce than, Add below code at the end of your theme’s functions.php file of your active child theme (or theme) and Save the file to remove billing detail for all users in woocommerce checkout.

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_email']);
    unset($fields['billing']['billing_city']);
    return $fields;
}
Scroll to Top