I have two taxonomies for my custom post type: location and price-range.

location is hierarchical: city > region > suburb ... price-range isn't.

When a user goes into a URL like ww.page.com/location/{city} I show a special homepage built for that city.

In every other case (www.page.com/location/{region}, www.page.com/location/{suburb}, www.page.com/price-range/{price}) the user gets redirected to a category pace showing a list of custom posts tagged with that term.

However, for SEO purposes I want the URLS to be slightly different. For the homepages (www.page.com/location/{city}) I want it to be www.page.com/{city} and for the rest of the cases I want www.page.com/{city}/{term}, where term could be any region, suburb, or price-range.

When a user goes into www.page.com/price-range/{price} I have the city stored in a session variable and this allows me to query custom posts with a specific price-range within the correct city. This behaviour is already implemented. All I want is to remove the taxonomy name from the URL (location or price-range) and replace it with the city I have stored in the session variable.

Is this possible? By doing so, I don't want to change the way Wordpress looks up the correct template file. That already works the way it should. I just want to change the URLS to make them a bit prettier.

Also, my custom post type is called listing. To see the details of a particular listing, I have to use the URL www.page.com/listing/{listing_name}. Again, I would like to have something like www.page.com/{city}/{listing_name}

Thanks in advance. Any suggestion will be greatly appreciated.

  • From my point of view, the URL changes you have in mind doesn't affect to SEO, at least as a direct factor, maybe it can affect if that change super-charge the user experience in your site and after some time the user engagement revert on the SEO, but I don't think you get that result by changing the URL in that way. Apart to that opinion, your requeriments would need a lot of job and testing; you need to narrow down your question to specific issues to be answerable here. – cybmeta Jan 30 '15 at 8:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.