URL issues with WordPress

This is not fixable, and there are good reasons for this.

Say we had a post with the slug ‘apple’, resulting in /category1/apple. What your question is asking, is how would we add another post with an identical slug, such that it’s URL was /category2/apple?

If this was done:

  • If you referred to the post via its slug in a get_posts or wp_query, which post would it load? It’s ambiguous
  • Those aren’t the only URLs that work, if we loaded /post/apple, would it load the apple in category1 or category2?
  • What about /index.php?p=apple ?
  • What if a 3rd apple is added, that is in both category 1 and category 2, which apple should be used?

These issues are not trivial to overcome, and they will occur if you manage this. It is not in your interests to do this. I can understand the marketing reasoning, but it is not possible with posts from a technical standpoint.

If you wanted to do it, modifying the database would be necessary, but I strongly advise against this, as it would invoke a number of problems, and could leave you with either:

  • A broken wordpress
  • Access to the first ‘apple’ post you wrote but not the second.
  • various errors in the backend