Last active
November 14, 2025 06:07
-
-
Save cryptexvinci/75ba823a824b29e04a08ee7893fc0ee5 to your computer and use it in GitHub Desktop.
Remove fields from WooCommerce checkout page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| add_filter( 'woocommerce_checkout_fields' , 'custom_remove_woo_checkout_fields' ); | |
| function custom_remove_woo_checkout_fields( $fields ) { | |
| // 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']); | |
| return $fields; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Also I have recently had a problem with Square payments when used with Motopress Hotel Booking whereby the email is not carried through from Motopress to Square so I have had to comment out the billing-email line. It did work perfectly up till now.