Black Friday & Cyber Monday SUPER SALE ALL WEEK:
Grab 40% OFF on plugins
Days
Hours
Minutes
Seconds

How to Make the Billing Form PIN Code Field Optional in WooCommerce?

If you want to make the postcode field optional in the WooCommerce checkout billing form, you can use the following code snippet. This code modifies the default address fields to set the postcode as not required.

add_filter( 'woocommerce_default_address_fields', 'customise_postcode_fields' );
function customise_postcode_fields( $address_fields ) {
    $address_fields['postcode']['required'] = false;

    return $address_fields;
}

Output

The below output shows that the Postcode has changed from a required field to an optional field in the WooCommerce checkout billing form.

How to Make the Billing Form PIN Code Field Optional in WooCommerce?

Additionally, you can also change postcode shipping field to a dropdown in WooCommerce checkout page.

Browse more in: Code Snippets, WooCommerce How Tos, WooCommerce Tutorials

Share It:

Subscribe
Notify of
0 Comments
Newest
Oldest
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible.

Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

By using our site, you acknowledge that you have read and understood our Privacy Policy and Terms & Conditions.