/** unrequiered checkout fields**/ add_filter( 'woocommerce_default_address_fields', 'customise_postcode_fields' ); function customise_postcode_fields( $address_fields ) { $address_fields['postcode']['required'] = false; return $address_fields; } add_filter( 'woocommerce_checkout_fields' , 'misha_not_required_fields', 9999 ); function misha_not_required_fields( $f ) { unset( $f['billing']['billing_postcode']['required'] ); unset( $f['shipping']['shipping_postcode']['required'] ); // the same way you can make any field required, example: // $f['billing']['billing_company']['required'] = true; return $f; }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter