Postal Code Search Returns No Results

Searching by postal codes can return unexpected results. This often happens when then search is not restricted to a single country, but also because by default the user input is always assumed to be an address. So when you provide a postal code instead, the Google Geocode API may not return the expected results.

There are two known bugs that are open in the Google Issue tracker that may affect the returned results for postal code searches. So based on where the postal code is located, it may just not work until Google fixes it.

There are a couple of steps you can take to increase the accuracy of postal code only searches.

Set a Map Region

Restricting the results to a single country ( map region ) in combination with enabling the ‘Restrict the geocoding results to the selected map region?’ option will make sure the results are restricted to the selected country.

This can make a big difference since for example the 2000 postal code exist in multiple countries, but if you specify the country you want the Google Geocode API to search in, then it will more likely return the expected results.

Enable the ‘Force zip code only search’ Option on the Settings Page

Enabling this option will tell the Google Geocode API that the input is a postal code instead of an address. The only downside of using this option is that it will break address searches, so users will only see results if they provide a valid postal code.

Enable Autocomplete

You can also try to enable the autocomplete option to make sure the user selects the postal code in the correct country. But using this option on a high traffic website may drive up the cost of the API usage. To prevent surprises you can set budget alerts.