How to remove WooCommerce Checkout Fields

Person in black and white t-shirt using computer

Add this code to the child-theme functions.php file

add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields_by_bsf', 99 );
// Remove some fields from billing form
// Fahim MUrshed https://fahimm.com
// Our hooked in function - $fields is passed via the filter!
// Get all the fields - https://docs.woothemes.com/document/tutorial-customising-checkout-fields-using-actions-and-filters/
// Refer to this tutorial - https://wpbeaches.com/remove-address-fields-in-woocommerce-checkout/
function custom_override_checkout_fields_by_bsf( $fields ) {
     unset($fields['billing']['billing_address_2']);
     
    //  You can remove others files just uncomment //
 
    // unset($fields['billing']['billing_company']);
    // unset($fields['billing']['billing_address_1']);
    // unset($fields['billing']['billing_postcode']);
    // unset($fields['billing']['billing_state']);
 
     return $fields;
}

Leave a Reply

%d bloggers like this: