I have a page called "Art" that can be viewed at /art. I also have a custom post type called "samples" with a post called "Art" inside of it. It SHOULD be viewed at /samples/art. For some reason, instead of having /samples/art as the URL, WordPress is forcing /samples/art-2.

The Art page and the Art post are two completely irrelevant pieces of data. Is there any way to let both of these entities exist with a clean URL?

  • Somewhere in your custom post type, there can be a draft or deleted post that had the slug art. I think that forced the Sample's post to get /samples/art-2. If that previous post can be deleted permanently, your desired slug for Sample's post can be acquired. Nov 22 '13 at 2:27
  • Yah I thought that might be the case too, but there doesn't seem to be anything else. As a second test, I went to the page and changed it's slug to /artx and then I was able to make the art post type /samples/art. So it's definitely the page that is blocking the post type's slug.
    – CodeSmith
    Nov 22 '13 at 2:49
  • 1
    Since a page and a CPT would generate the same permalink (under the right conditions) it doesn't surprise me that you are having trouble with this.
    – s_ha_dum
    Nov 22 '13 at 4:27
  • Is your samples CPT hierarchical (and if it needs to be)? Try switching it not hierarchical.
    – Rarst
    Nov 22 '13 at 10:40
  • Yes it is hierarchical; under Art I list some specific examples. This sounds like an extremely limiting design flaw in Wordpress.
    – CodeSmith
    Nov 22 '13 at 10:56

This is a known bug (or design flaw) that seems be getting some attention by the Wordpress team. Take a look at this discussion https://core.trac.wordpress.org/ticket/18962 for more information. As of Wordpress 4.0 this is still an issue.

  • Thank you for finally clearing this up! Good to know they're actively working on a solution.
    – CodeSmith
    Oct 20 '14 at 3:08

Your Answer

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

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