In order to hide woocomerce checkout fields, you need to add a custom code in function.php of your theme. We recommend you use a child theme to do this to avoid loosing the code when you update the theme. Alternatively you can try out some plugins that allows you to add custom functions in your theme without affecting the WP theme. Install My Custom Functions plugin and add the code below in it
/* WooCommerce: The Code Below Removes Checkout Fields */ 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_email']); unset($fields['account']['account_username']); unset($fields['account']['account_password']); unset($fields['account']['account_password-2']); return $fields; }
The code is simple to understand, for example if you want to hide Username , password and confirm password fields just enter the following code
add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' ); function custom_override_checkout_fields( $fields ) { unset($fields['account']['account_username']); unset($fields['account']['account_password']); unset($fields['account']['account_password-2']); return $fields; }
You can also comment each line you want to display eg.
add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' ); function custom_override_checkout_fields( $fields ) { //unset($fields['account']['account_username']); unset($fields['account']['account_password']); unset($fields['account']['account_password-2']); return $fields; }
The code above will hide password and confirm password fields.