October 17, 2022
How to Disable Postcode/ZIP Validation on Checkout of WooCommerce
For sellers who are not using postcodes is annoying, since the general format of the Woocomerce checkout page has a mandatory ZIP validation.
But to make things easy for you, here you will learn how to turn off the “REQUIRED” Postcode/Zip label on the checkout page.
We will leave the box on the checkout page and just avoid a validation error if we don’t enter anything.
Check out two easy methods to disable postcode validation of WooCommerce checkout page.
Method 1: Disable Postcode/ZIP Validation in WooCommerce Checkout
<?php add_filter( 'woocommerce_default_address_fields' , 'change_postcode_validation' ); function change_postcode_validation( $address_fields ) { $address_fields['postcode']['required'] = false; return $address_fields; } ?>
Method 2: Disable Postcode/ZIP Validation in WooCommerce Checkout
<?php add_filter( 'woocommerce_checkout_fields' , 'change_postcode_validation' ); function change_postcode_validation( $fields ) { $fields['billing']['billing_postcode']['required'] = false; $fields['shipping']['shipping_postcode']['required'] = false; return $fields; } ?>