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'm creating a website and I'd like to be able to reuse the same slug/post name in the page's url.

ex using /%category%/%postname%

foo.com/barz/page // Will not work. Instead it will use page-2.

I've done some research and it doesn't look like it's possible to do what I want. Before I give up on trying to get the url structure to work like I would like, I figured I would reach out to the WordPress community to see if anything has changed in a newer release to allow this behavior. I'd really like to avoid using %post_id% at all costs because I don't think it looks very nice in the url.

share|improve this question
up vote 2 down vote accepted

This is not natively possible, since in your example permalink structure posts are detected by slug alone, and not combination with category. Essentially category info gets simply discarded.

If your requirements involve only one (few) of possible endings for URL you might achieve this relatively easy using endpoints, see add_rewrite_endpoint().

However in generic scenario slug collisions won't work.

share|improve this answer
Thanks for the fast reply. It's a shame that WP discards the slug & category combination. I assume adding %post_id% to the permalink won't change anything? – Jordan May 3 '13 at 16:31
Probably won't. The post slug is essentially main textual identification for a post (since GUIDs are a mess) and WP doesn't like it collide. – Rarst May 3 '13 at 16:35
Thanks for the help! – Jordan May 3 '13 at 16:36

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.