Skip to content

Instantly share code, notes, and snippets.

@mijimoco
Created December 1, 2016 13:25
Show Gist options
  • Save mijimoco/4828b9c2821b3bbfe8beebfdde7a4860 to your computer and use it in GitHub Desktop.
Save mijimoco/4828b9c2821b3bbfe8beebfdde7a4860 to your computer and use it in GitHub Desktop.
Woocommerce remove billing&shipping fields from checkout form
// Hook in to Remove Checkout Fields
add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' );
function custom_override_checkout_fields( $fields ) {
unset($fields['billing']['billing_state']);
unset($fields['billing']['billing_address_2']);
unset($fields['billing']['billing_city']);
unset($fields['billing']['billing_postcode']);
unset($fields['billing']['billing_country']);
unset($fields['shipping']['shipping_company']);
unset($fields['shipping']['shipping_state']);
unset($fields['shipping']['shipping_address_2']);
unset($fields['shipping']['shipping_city']);
unset($fields['shipping']['shipping_postcode']);
unset($fields['shipping']['shipping_country']);
return $fields;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment