I'm having trouble creating a location based url for my site. Here is the url format I wanted:


The topic is the custom post type and 123 is the ID. "united-states/new-york-ny/brooklyn" is the 3 level categories. First I found a way to upload all the US states and cities into the category table: wp_terms and wp_term_taxonomy and assigned to the proper hierarchy. But there are total of 30000+ cities and states and now every time the page loads, it takes forever and a lot of time it's getting a timeout error. I'm not sure there is the right way to do it. I'm trying to ajax the category in the admin page but have no success. Please help...


  • 1
    So is your problem with the meta box on post.php taking too long to load, or with generating the correct rewrite rules for your categories and taxes? Could you clarify? Dec 15, 2010 at 17:05

1 Answer 1


Try putting the id first.
from the codex:

For performance reasons, it is not a good idea to start your permalink structure with the category, tag, author, or postname fields. The reason is that these are text fields, and using them at the beginning of your permalink structure it takes more time for WordPress to distinguish your Post URLs from Page URLs (which always use the text "page slug" as the URL), and to compensate, WordPress stores a lot of extra information in its database (so much that sites with lots of Pages have experienced difficulties).


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.