Skip to content

Instantly share code, notes, and snippets.

@jgalea
Last active June 9, 2020 19:58
Show Gist options
  • Star 14 You must be signed in to star a gist
  • Fork 12 You must be signed in to fork a gist
  • Save jgalea/5884548 to your computer and use it in GitHub Desktop.
Save jgalea/5884548 to your computer and use it in GitHub Desktop.
Remove billing details from 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;
}
@stefanbuttigieg
Copy link

Jean, the top part of <?php should be removed. Might cause some unpleasant suprises you know ;)!

@onigetoc
Copy link

Great, i found this one and it's working.
But you put billing_last_name Twice

@lanaluvlee
Copy link

This worked! Thank you very much. But it still left the titles "Billing" and "Additional Information" on the page.
Any additional code I can use to remove those? Cheers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment