Instantly share code, notes, and snippets.

Embed
What would you like to do?
Remove WooCommerce checkout page fields - sandeshjangam.com
<?php
/* This Code Will Removes "company", "address1" & "address2" Checkout Fields */
add_filter( 'woocommerce_checkout_fields' , 'custom_remove_checkout_fields' );
function custom_remove_checkout_fields( $fields ) {
/* Billing Field */
unset( $fields['billing']['billing_company'] );
unset( $fields['billing']['billing_address_1'] );
unset( $fields['billing']['billing_address_2'] );
return $fields;
}
<?php
/* This Code Will Removes All Billing & Additional Checkout Fields */
add_filter( 'woocommerce_checkout_fields' , 'custom_remove_checkout_fields' );
function custom_remove_checkout_fields( $fields ) {
/* Billing Field */
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'] );
/* Additional Filed */
unset( $fields['order']['order_comments'] );
return $fields;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment