I have my permalink format set to /%category%/%postname%/ and I have two posts with the same permalink slug, but in different categories.

Ideally, the two permalinks should look like this:


But when I publish the second post, then its slug is changed to post-title-2, which makes the resulting URL http://example.com/category-2/post-title-2/.

How can I use the same slug for multiple posts that are in different categories? This WordPress Support topic suggests using an outdated plugin that doesn't work anymore.

  • 2
    What should happen with a post that is in both categories?
    – fuxia
    Apr 14, 2013 at 7:53
  • @toscho The whole permalink should be checked as a duplicate instead of just the slug.
    – shea
    Apr 14, 2013 at 8:33
  • You would have to override the whole redirect_canonical mess. This is very error prone.
    – fuxia
    Apr 14, 2013 at 8:35
  • @toscho What if this special functionality was disabled if the post is in two categories, instead?
    – shea
    Apr 14, 2013 at 8:40

1 Answer 1


The best method is to find another way to structure your URLs that doesn't break unique slugs. Even though you may not have any plans to do so now, you may need to change the URL structure of the site down the road in such a way that having duplicate slugs would break the site. Furthermore, there may be unforeseen second- and third-order consequences to doing this, such as plugins that won't work or, worse, will cause fatal errors on the site because of slug collisions. Slugs are kept unique for a reason, and removing this check could wreak havoc going forward.

If your reason for wanting non-unique slugs is to make clean hierarchical URLs for easy sharing in non-linkable areas (print, images, etc.) you may want to consider using something like Quick Post/Page Redirect to allow simple URLs to forward to their full, more complex actual locations using a 301 redirect. It's not the most elegant or scalable solution, but it's not going to break compatibility the way non-unique slugs will.

If you just want attractive URLs for the sake of cleanliness in the browser, I'd recommend coming up with an alternative URL structure that can take advantage of unique slugs, such as incorporating the category name into the slug.


Your Answer

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

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