Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Background: We live in a small state and have 10 "stores" located throughout it. Each of these stores has their own WordPress Page. We have a master list of ZIP codes for our state (roughly 400 ZIP codes) and would like to assign these ZIP codes to one of the 10 WordPress Pages. If a user enters their ZIP code in a search field, we'd like to take them directly to the assigned "store" WordPress Page.

What's the best way to go about building this while keeping WordPress' best practices in mind? It's a pretty simple one-to-many relationship (Page -> ZIP codes) and I don't think any geocoding is needed, but I'm not an expert on building WordPress plugins and want to do things correctly.

I'm thinking a simple database table of the 400 ZIP codes with a "post_id" field corresponding to the correct WordPress page, but it would be nice to have some sort of interface on the backend that allows us to bulk-assign ZIP codes (via a multi-select box?) to a WordPress Page without having to edit each database row manually - are there any tools to help build these interfaces or is this something I'll have to create manually?

share|improve this question

1 Answer 1

You could assign a custom taxonomy called zip to the pages with register_taxonomy


You can also use a plugin for this, for example:



share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.