The following instructions require the Business Directory Zip Search plugin.
Downloads
ZIP Search supports the following databases:
- United States (670KB)
- UK (20MB)
- Australia (43KB)
- Austria (32KB)
- Belgium (19KB)
- Brazil (requires v5.0.1) (97KB)
- Canadian (8.8MB)
- Czech (63KB)
- Estonia (62KB)
- India (1.4MB)
- Italy (63KB)
- France (56KB)
- Germany (115KB)
- Japan (requires v5.0.9) (825KB)
- Lichtenstein (1KB)
- Luxembourg (requires v5.0.10) (40KB)
- Malaysia (31KB)
- Mexico (777KB)
- Netherlands (9MB)
- New Zealand (462KB)
- Norway (62KB)
- Philippines (requires v5.0.9) (28KB)
- Romania (186KB)
- South Africa (20KB)
- Spain (73KB)
- Switzerland (56KB)
- Combined European Postal (BE, AT, LI, CH, DE) database (221KB)
- Other countries not yet supported
If the country you need is not listed above, please contact us and send a CSV or XLSX file that includes the postal code, city, state, latitude, and longitude.
Installation
- Download one of the databases listed above.
- After downloading the database(s), go to Directory > Settings > Listings > Searching and click the Import ZIP code database link at the bottom of the page.
On the Import ZIP code database page, select the first file you downloaded for import. Click Choose File and then Upload File to get started: - Once the upload is complete, which may take a few min depending on the size of the database you're uploading, next you must import the data from the file into your own BD database. Do this by clicking the Start Import button on the next screen:
- The database import can take a long, long time, depending on the database you're using (UK is a long one, US and Australia import pretty quickly. Canada is in between). When I first imported the US database on a reasonably fast server, it took 20 min. UK databases seem to take the longest–over 4 hours in some cases! It all depends on your hosting server horsepower and RAM. Once the database import is complete, the module will automatically build a cache of the ZIP data for you. Now you're ready to map your ZIP code field and begin searches:
- You should map the field you defined as ZIP/Postal Code and update the units to Miles or Kilometers for the the proper output of the search. Once you do that, click Save Changes and you're done!
- To import additional databases, simply go back to Step 1 and repeat for each new database you want.
NOTE: These databases are only compatible with the Business Directory ZIP Search.
Error Uploading Zip Database
There can be situations where you can get an error at the time of uploading the database file.
This means your website does not support uploading a .gz file type. To resolve this, you'd need to allow adding the .gz file type to your website. Instructions are outlined below.
Allow extra file types
If you would like to allow file types than are not allowed in WordPress by default, you'll need some custom code.
add_filter('upload_mimes','restrict_mime'); function restrict_mime($mimes) { $mimes['mp4'] = 'video/mp4'; $mimes['csv'] = 'text/csv'; //allow csv files $mimes['avi'] = 'video/x-msvideo'; //add avi $mimes['mov'] = 'video/quicktime'; //add mov $mimes['epub'] = 'application/epub+zip'; //add epub $mimes['ai'] = 'application/postscript'; //add ai $mimes['eps'] = 'application/postscript'; //add eps $mimes['xml'] = 'application/xml'; //add xml $mimes['gz'] = 'application/gz'; //add gz return $mimes; }
This is a WordPress filter (not Business Directory). You can find more information on this filter in the WordPress codex.