There may come a time where you need to ensure that the postal codes entered in by your UK customers are valid. The code recipe below uses the free third-party Postcodes.io API to validate the postal code upon checkout. This code recipe could be adapted to validate for other regions.
The Code Recipe
Adding the Recipe to Your Website
You can add this recipe to your site by creating a custom plugin or using the Code Snippets plugin available for free in the WordPress repository. Read this companion article for step-by-step directions on either method.
The validation will only run if the “Billing County” on the Membership Checkout form is set to the UK.
Get Support From Our Team of Experts
Have a question about how to use this feature? Our Support Page outlines three ways to get support.
Our Max plans include hands-on help customizing your membership site and implementing new features. Upgrade to PMPro Max now »


