WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to implement a state-city selection for my users to choose from. Where they first choose their state and then there is a city drop down field that shows only the cities in that state.

Currently, users have to type in the state and city for their account. This concerns me because they may not enter the correct names. I would like this in order to keep these values consistent and to make the site more user friendly.

I thought about creating all the states and cities as categories. I tried this which totaled to over 10,300 categories and sort of crashed my site. Certain pages that needed to access the categories would take update 10 minutes to load the page due to the large number of categories it had to process.

I am looking a solution to this. I would like them to choose their state from a dropdown list and then based on the state chosen they can pick a city of that state from a dropdown list.

I need some major help with this. Thanks a lot.

share|improve this question
up vote 1 down vote accepted

This isn't a WordPress question, its more suitable for StackOverflow.

Regardless, your looking for a chained menu. I've seen this tutorial around a lot, hope it helps.

share|improve this answer
Thanks M.Taylor. I'll try out this solution. I appreciate it. – user1893 Jun 22 '11 at 23:32
The link is dead (in some browsers, here: Opera). Do you know a better resource or can you add some sample code? – toscho Jul 30 '12 at 8:48
The Internet Archive Wayback Machine is always a good tool whenever a link dies. – brasofilo Jul 30 '12 at 9:14

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.