WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Post & Page with the same slug (9 posts)

  1. AK Ted
    Member
    Posted 1 year ago #

    If you create a post with a title (and slug) - I'll use test as an example - and later create a page with the same title/slug, WordPress doesn't notice the collision and try to change the slug for you. If you try to create/change a post's slug to an existing post slug, it'll put a '-2' at the end. Same with a page. But WP doesn't seem to cross-check between posts and pages.

    Is this a bug, or just the way it is (for whatever reason)?

  2. WP does "check" and notice the potential collision; that's why WP adds the -2. It's not a bug. The "whatever reason" is to prevent slug collisions.

    That's the way WP works to prevent slug collisions. Any site can have a `%postname% permalink structure, and that will show the same slug for a post and page.

  3. AK Ted
    Member
    Posted 1 year ago #

    What I'm saying is WP does *not* check for collisions between post and page. This was tested on a clean 3.5 install.

  4. What I'm saying is WP does *not* check for collisions between post and page.

    Yes, it does. And WP adds the -2 to prevent collisions. What's your definition of "check?"

  5. AK Ted
    Member
    Posted 1 year ago #

    In my tests it does not put the -2. If, like I said in the OP, you test post-to-post or page-to-page, it does add the -2. But if you have a post with slug "whatever", and you later add a page "whatever", WordPress lets you. Same slug for page & post. The post is now inaccessible.

  6. cwwallis
    Member
    Posted 1 year ago #

    I agree with AK Ted. I have a new site with 3.5 and it is not checking post slugs to page slugs and adding the -2 like it would if I add another post

  7. AK Ted
    Member
    Posted 1 year ago #

    Trac ticket created, will update this thread as necessary.

  8. AK Ted
    Member
    Posted 1 year ago #

    My ticket has been closed and marked as a duplicate of this Trac ticket, which was filed nearly 2 years 8 months ago.

  9. wasanajones
    Member
    Posted 10 months ago #

    same problem... and why are moderators so eager to close threads calling them resolved... when ... they are not... (in favor of something that was started three years ago)

Topic Closed

This topic has been closed to new replies.

About this Topic