Title: Restrict based on postcode / zip code
Last modified: January 16, 2018

---

# Restrict based on postcode / zip code

 *  Resolved [danbrady](https://wordpress.org/support/users/danbrady/)
 * (@danbrady)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/restrict-based-on-postcode-zip-code/)
 * I love this plugin, but one issue affects its usability.
 * Many street names are not unique, and often the correct address does not appear
   in the first few results.
 * For instance, in the UK if I type “12 High Street”, there are hundreds of matches.
   This occurs for many less common addresses too. In practice, a user doesn’t see
   their address, so continues to type out their address manually – defeating the
   purpose of the plugin.
 * I would like to be able to restrict the search based on postcode / zip code. 
   So, we can present the address fields in this order:
 * 1. Country
    2. Post code / zip code 3. Street address (auto complete field)
 * The search would be restricted only within the postcode area. This means the 
   correct address appears *every time* (in the UK at least).
 * Is this possible? (i.e. restrict by postcode, if that field has a value entered)
 * Thanks

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Thread Starter [danbrady](https://wordpress.org/support/users/danbrady/)
 * (@danbrady)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/restrict-based-on-postcode-zip-code/#post-9872383)
 * To add to my comment above, I have noticed that many users don’t realise they
   can type their *full* address, in the ‘Street address’ field.
 * If a user continues to type their town name or postcode, the address selection
   works fine. But users often don’t do this as the field is labelled ‘Street Address’
   so they only type their door number and street name, which is not specific enough.
 * This is why I’d like the plugin to look at other fields entered too, not just
   country and street address.
 * Hope that makes sense?
    -  This reply was modified 8 years, 4 months ago by [danbrady](https://wordpress.org/support/users/danbrady/).
 *  Thread Starter [danbrady](https://wordpress.org/support/users/danbrady/)
 * (@danbrady)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/restrict-based-on-postcode-zip-code/#post-9881663)
 * A better idea (and I realise I’m taking to myself here) would be to show results
   in the postcode field too
 * So:
 * 1. User selects country
    2. User types post code 3. Plugin shows a drop down 
   with all addresses in that postcode, user selects the correct address
 * This would work well for UK addresses, where there aren’t that many addresses
   per post code. And I’ve used sites that do this, eg this registration page: [https://www.priorydirect.co.uk/register](https://www.priorydirect.co.uk/register)
 * However, in the US a zip code can have thousands of addresses, so further filtering
   would be needed, e.g. door number AND Zip code
 * One way round this would be to allow the plugin to be configured to optional 
   hook into different address fields, and let the site admin choose. E.g. in th
   plugin settings, choose to use `street address` or `post code` . As I’m building
   UK site, I would choose post code
 * Any ideas?
    -  This reply was modified 8 years, 4 months ago by [danbrady](https://wordpress.org/support/users/danbrady/).
 *  Thread Starter [danbrady](https://wordpress.org/support/users/danbrady/)
 * (@danbrady)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/restrict-based-on-postcode-zip-code/#post-9895262)
 * Is anyone monitoring these support threads?
 *  Plugin Contributor [natekinkead](https://wordpress.org/support/users/natekinkead/)
 * (@natekinkead)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/restrict-based-on-postcode-zip-code/#post-9896189)
 * Yes, I apologize for the delay in responding to you.
 * These are great suggestions, however, I don’t think they are too feasible.
 * Rearranging the order of the address fields in WooCommerce is getting quite a
   bit outside of the intended scope of this plugin, especially since it works fine
   for the majority of addresses. I also think people will continue to type their
   address details until they see it show up. Adding a zip code before it would 
   defeat much of the purpose of this plugin which is to reduce the amount of typing
   people need to fill out their address.
 *  Thread Starter [danbrady](https://wordpress.org/support/users/danbrady/)
 * (@danbrady)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/restrict-based-on-postcode-zip-code/#post-9896404)
 * Thanks for your reply
 * > I also think people will continue to type their address details until they 
   > see it show up.
 * I referred to this in my first comment. In testing, I’ve seen that this often
   isn’t true. The plugin acts on the ‘street address’ field. Many people type in
   their door number and street name, then see a list of unrelated addresses. Many
   people **don’t realise they can continue typing**, to further refine the address
   suggestions. Therefore, they often skip to manually entering their address. Which
   defeats the plugin purpose.
 * > Adding a zip code before it would defeat much of the purpose of this plugin
   > which is to reduce the amount of typing people need to fill out their address
 * In the UK at least, the optimum approach used on many e-commerce sites, is to
   ask for door number and postcode, because that is the smallest unique address
   possible. (Each door number is unique per postcode). The version I linked to 
   above is a variation on this, using google autocomplete. The user is asked to
   type their postcode, then is presented with all matching addresses in a list,
   and the user clicks their address. I suggest you try it, eg with: NE6 2BA
 * I’d be interested in knowing what you’d charge to add this functionality. Can
   be discussed privately.
 * Thanks
    -  This reply was modified 8 years, 3 months ago by [danbrady](https://wordpress.org/support/users/danbrady/).
 *  Plugin Contributor [natekinkead](https://wordpress.org/support/users/natekinkead/)
 * (@natekinkead)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/restrict-based-on-postcode-zip-code/#post-9904596)
 * Go ahead and fill out the contact form at [https://www.ecreations.net/contact/](https://www.ecreations.net/contact/)
   and mention this thread, and we can discuss offline. Thanks.
 *  Thread Starter [danbrady](https://wordpress.org/support/users/danbrady/)
 * (@danbrady)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/restrict-based-on-postcode-zip-code/#post-9930287)
 * Thanks Nate, I’ve emailed you via that form

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Restrict based on postcode / zip code’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/checkout-address-autocomplete-for-
   woocommerce_bba598.svg)
 * [Checkout Address Autocomplete for WooCommerce](https://wordpress.org/plugins/checkout-address-autocomplete-for-woocommerce/)
 * [Support Threads](https://wordpress.org/support/plugin/checkout-address-autocomplete-for-woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/checkout-address-autocomplete-for-woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/checkout-address-autocomplete-for-woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/checkout-address-autocomplete-for-woocommerce/reviews/)

 * 7 replies
 * 2 participants
 * Last reply from: [danbrady](https://wordpress.org/support/users/danbrady/)
 * Last activity: [8 years, 3 months ago](https://wordpress.org/support/topic/restrict-based-on-postcode-zip-code/#post-9930287)
 * Status: resolved