WordPress.org

Ready to get started?Download WordPress

Forums

Permalinks and duplicate page slugs (9 posts)

  1. metrictensor
    Member
    Posted 8 years ago #

    Hi,

    I am using WP as a CMS and have created loads of sections using parent pages with multiple sub pages in each section. Some of these sub sections are common and have common names, for instance there are multiple pages called "Contact Information" related to each sub section.

    The site works perfectly, until I turn on permalinks. Then if I click on any page which has a duplicate name, for instance "Contact Information", the page displays all the other pages with that slug, instead of the single page.

    What is happening within the loop which is causing WP to fetch pages by slug/name as opposed to the unique ID? Am I correct in assuming this is whats happening? How can I fix it?

    Michael.

  2. What version of WordPress are you running?

  3. schulte
    Member
    Posted 8 years ago #

  4. metrictensor
    Member
    Posted 8 years ago #

    @macmanx
    v 1.5.2

    @schulte
    Thanks for the trac links, I am reading trough them at the moment. They look like my problem.

    Cheers.

  5. metrictensor
    Member
    Posted 8 years ago #

    From http://trac.wordpress.org/ticket/1428:

    -------------------
    Ticket #1428
    Static pages break when two or more have the same title but different parents
    -------------------
    Priority: normal Reporter: radgeek
    Severity: normal Assigned to: anonymous
    Component: General Status: new
    Version: 1.5.2 Resolution:
    Milestone: 1.6 Keywords:
    -------------------

    Does this mean the bug is due to be corrected in version 1.6? What are my options at the moment? Create unique page slugs?

    Michael.

  6. schulte
    Member
    Posted 8 years ago #

    That's the way I'd interpret it. I think the best course of action would be the unique page slug route...

  7. WP v1.5.x should append numbers to the slugs of posts/pages with duplicate titles, for example: /post-title/ and /post-title-2/ But, this may not affect posts made with WP versions before v1.5, which is when the date-structured permalink was the recommended route. As stated by Schulte, It looks like you will have to manually change the post/page slugs to unique values in order to fix the problem.

  8. metrictensor
    Member
    Posted 8 years ago #

    Unique slugs have corrected the problem.

    Thanks for all your help, twas much appreciated.
    Michael.

  9. janit
    Member
    Posted 8 years ago #

    I've created a plugin to solve this problem for now: http://janit.iki.fi/temp/page_slug_checkr.phps

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags