How to Remove Checkout Fields in WooCommerce?

I’m using WooCommerce for my online store, but I want to simplify the checkout process for my customers by removing some unnecessary fields. Specifically, I want to remove fields like “Company Name,” “Address Line 2,” and “Phone Number.” Can someone guide me on how to achieve this?

Removing checkout fields in WooCommerce can be done by adding some code to your theme’s functions.php file or by using a plugin. Here’s a simple way to do it using code, just use woocommerce_checkout_fields filter and unset any unwanted checkout fields.

add_filter( 'woocommerce_checkout_fields' , 'remove_unwanted_checkout_fields' );
function remove_unwanted_checkout_fields( $fields ){
   // Remove company name field
    unset( $fields['billing']['billing_company'] );
    
    // Remove address line 2 field
    unset( $fields['billing']['billing_address_2'] );
    
    // Remove phone number field
    unset( $fields['billing']['billing_phone'] );
}

Here you can find the available fields that you can remove:

    // remove billing 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['billing']['billing_email']);
	
    // remove shipping fields 
	unset($fields['shipping']['shipping_first_name']);    
	unset($fields['shipping']['shipping_last_name']);  
	unset($fields['shipping']['shipping_company']);
	unset($fields['shipping']['shipping_address_1']);
	unset($fields['shipping']['shipping_address_2']);
	unset($fields['shipping']['shipping_city']);
	unset($fields['shipping']['shipping_postcode']);
	unset($fields['shipping']['shipping_country']);
	unset($fields['shipping']['shipping_state']);
	
    // remove order comment fields
	unset($fields['order']['order_comments']);

	// account fields
	unset($fields['account']['account_username']);
	unset($fields['account']['account_password']);
	unset($fields['account']['account_password-2']);