WooCommerce: Disable PostCode/Zip Field on the Checkout Page

In some countries there is no Postcode/ZIP (such as Ireland!). How do we make the Postcode/ZIP field not required, or how do we completely remove it? The answer is very simple.

Remove the Postcode Field on the WooCommerce Checkout Page
Remove the Postcode Field on the WooCommerce Checkout Page

PHP Snippet: Remove Postcode/ZIP Field @ WooCommerce Checkout


/**
* @snippet Remove the Postcode Field on the WooCommerce Checkout
* @how-to Get CustomizeWoo.com FREE
* @sourcecode https://businessbloomer.com/?p=461
* @author Rodolfo Melogli
* @testedwith WooCommerce 3.5.1
*/

add_filter( 'woocommerce_checkout_fields' , 'bbloomer_remove_billing_postcode_checkout' );

function bbloomer_remove_billing_postcode_checkout( $fields ) {
  unset($fields['billing']['billing_postcode']);
  return $fields;
}

Official Documentation

https://docs.woothemes.com/document/tutorial-customising-checkout-fields-using-actions-and-filters/

Where to add custom code?

You should place custom PHP in functions.php and custom CSS in style.css of your child theme: where to place WooCommerce customization?

This code still works, unless you report otherwise. To exclude conflicts, temporarily switch to the Storefront theme, disable all plugins except WooCommerce, and test the snippet again: WooCommerce troubleshooting 101

Related content

Rodolfo Melogli

Business Bloomer Founder

Author, WooCommerce expert and WordCamp speaker, Rodolfo has worked as an independent WooCommerce freelancer since 2011. His goal is to help entrepreneurs and developers overcome their WooCommerce nightmares. Rodolfo loves travelling, chasing tennis & soccer balls and, of course, wood fired oven pizza. Follow @rmelogli

50 thoughts on “WooCommerce: Disable PostCode/Zip Field on the Checkout Page

  1. Thanks for the code Rodolfo – still works perfectly!

  2. thank you

  3. Worked Perfectly fine Thanks

  4. Thank you very much, it’s working fine for me, so I can remove a plugin to do this function before …

    1. Spot on

  5. hi, this doesnt work, copied and pasted exactly, but no change. what could have gone wrong?

    1. No idea, sorry

  6. It worked perfectly, thank you!

    1. Awesome

  7. It really works. Thank you Rodolfo,

    1. You’re welcome!

  8. Hi there.

    And thanks for share these all codes.
    Question.
    If i need hide/unset field in checkout>billing/shipping adress.
    Based on a multiple countries?

    I have this peace of code, but how make this to multiple countries? And multiple fields?

    
    add_filter( 'woocommerce_checkout_fields', 'custom_override_checkout_fields' );
    
    function custom_override_checkout_fields($fields){
        global $woocommerce;
        $country = $woocommerce->customer->get_billing_country();
        	if($country !== 'AO'){
        		unset($fields['billing']['billing_postcode']);
        	}
        return $fields;
    }
    

    Thank you

    1. Hi Jsotnas, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!

    2. Hi Rodolfo,

      How much?

      Thank you

      1. Hi there, please contact me in private. Thank you!

  9. Hey. Is it possible to have a validation for post code so that the customer does not enter 0000?
    Thanks.

    1. Hello Nalia, thanks so much for your comment! Yes, this is possible – unfortunately this is custom work and I cannot provide a complementary solution here via the blog comments. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding! ~R

  10. Using this snippet, you can remove multiple checkout fields. Just be sure to modify the field name, both filter and function. For example, if you don’t ship to more than one country, you could remove the country field by replacing “postcode” with “country”.
    If you need to remove multiple fields or customize them more, use a plugin.

    1. Thank you Cristian 🙂

  11. Hi Today i have customize one of zip-code checker plugin using help of your all hooks code…i am Really thanks full to you.

    1. Cool, thank you Mounish!

  12. It worked.. Thanks..
    What I need to add to this code so PostalCode dissapear from Editiing Billing & Shipping Addresses?
    Thanks

    1. Gabriel, thanks for your comment! Yes, this is possible – but unfortunately this is custom work and I cannot provide a complementary solution here on the blog. Thanks a lot for your understanding! ~R

  13. thanks it worked for me

    1. Excellent! Thanks Adnan 🙂

  14. hello, I copy and paste the code to function.php but it doesnt work.

    1. Hey Burak, it should work 🙂 Just to make sure, the correct file is functions.php (with an “S” at the end). Let me know!

  15. Where can i paste the text? I can’t seem to find the place to paste it.

    Kind regards,

    Hannah

    1. Hello Hannah, thanks for your comment! You can place this snippet in your child theme’s functions.php file – if you need more guidance, please take a look at this video tutorial: https://businessbloomer.com/woocommerce-customization-hangout/

  16. Thank you Rodolfo, It was driving me crazy 🙂

    1. No problem Jose! Thanks for your feedback 🙂

  17. Hi there, thanks for the plugin, however when I have tried to make the postcode field not mandatory and also removing it completely, Woo COmmerce checkout STILL shows “Please enter a valid postcode/ZIP” Even when the field isn’t visible during checkout… Any help is greatly appreciated. Rick

    1. Hey Rick, thanks for your comment 🙂 This is strange, I use this trick on all my sites and get no validation warning. Are you running all the latest versions of WooCommerce / plugins / Theme / WP?

  18. It really works but it change the other field in my checkout form 🙁

    1. Hey Adi thanks for your feedback 🙂 What “other field” are you referring to?

  19. Excelent job, it works, thank you very much!

  20. Hi Rodolfo, this sounds great, but will I have the option to remove the requirement for a postcode on the Shopping Cart page, where I calculate shipping?

    1. Noelle, thanks for your feedback! Unfortunately you can’t do what you’re asking, see this post from Woocommerce developer. However, you could disable the shipping calculator all together from the Woo settings 🙂

      1. Thanks for your reply, Rodolfo 😉

        1. You’re welcome 🙂

          1. Hi again Rodolfo, I just installed the free plugin and it works great, thank you! I just thought i’d send you the suggestion to have the minimal fields within the billing and shipping address settings as defaulting to ‘required’. For example, I nearly lost a sale because my billing and shipping sections don’t have ‘State/County’ as fields and yet the default setting is to have this field as ‘required’. It doesn’t seem to have affected customers from Ireland but a customer from the Netherlands was not able to complete her purchase because she could not move past this point. I suppose I should have checked all of the settings, but I didn’t. Just a suggestion for others who are lazy about checking these things like me! Thanks again!

            1. Thanks so much for your feedback Noelle!

  21. Thank your tips. It’s work for me

  22. Hi, I am trying to eliminate en billing checkout the zip code but is not working.
    your plugin working with woocommerce 2.3.7??

    1. Hello Efrain 🙂 Thanks for your feedback. The plugin definitely works, I use it on all my websites – could you possibly send a screenshot of your Checkout Billing plugin settings (as per my article) so that I can take a look?

Questions? Feedback? Customization? Leave your comment now!
_____

If you are writing code, please wrap it like so: [php]code_here[/php]. Failure to complying with this, as well as going off topic or not using the English language will result in comment disapproval. You should expect a reply in about 2 weeks - this is a popular blog but I need to get paid work done first. Please consider joining the Business Bloomer Club to get quick WooCommerce support. Thank you!

Your email address will not be published. Required fields are marked *