WordPress.org

Ready to get started?Download WordPress

Forums

Child Categories error out as Duplicates (10 posts)

  1. hxf148
    Member
    Posted 6 years ago #

    After upgrading to WordPress 2.5 I am getting this error when trying to add a new child category when the name of a that category exists within a different parent.

    For example, if I have:

    Photos
    -Summer

    and then I try to add a new category called Summer with a different parent like:

    Videos
    -Summer

    WordPress is throwing an error:
    "The category you are trying to create already exists."

    Any workaround/fix/user error?
    Thanks in advance.
    Harold

  2. MichaelH
    Member
    Posted 6 years ago #

    Duplicate Category (and Tag) names are no longer allowed.

  3. hxf148
    Member
    Posted 6 years ago #

    I think this is a big mistake and will force at least two clients of mine to continue to use pre 2.5 versions.

    From my perspective categories with different parents or levels should be able to have the same literal name. CatA->Apple, CatB->Apple are not the same thing and should be allowed.

    Very disappointed with this direction.

  4. MichaelH
    Member
    Posted 6 years ago #

    I'm mixed on that but if you feel strongly about that then open a ticket in Trac with your suggestion.

    User your forum login/password there.

    Might also refer to Trac ticket 3799 in your ticket.

  5. hxf148
    Member
    Posted 6 years ago #

    Ticket #6542 (new defect)
    Child Categories error out as Duplicates
    http://trac.wordpress.org/ticket/6542

    Thanks for your help Michael.

  6. wordmonkey
    Member
    Posted 6 years ago #

    I think there's a work around on this - I was using duplicate names for categories and, again, it's essential for me that a child of one category could have the same name as a child in the other.

    I've managed to get around this by ensuring that the Category Slug for each is different. That seems to be the element that WordPress is checking for duplicates. So make your two new categories but put a spelling mistake or something in the category name of the second one. When it's made, go back and edit the Category Name to the words you want but make sure to also change the Category Slug to a corrected version with extra words in it - maybe a reference to which parent it refers to or something like that.

    So in your example, you could make a child category Summer in parent category Photos, no problem. When making the second, initially create it a Sumer in Video. Then edit the category once it's made, correct the Sumer to Summer and rename the slug to something like summer-videos.

    Seems to work.

  7. hxf148
    Member
    Posted 6 years ago #

    Thanks for the find.

    I am confirming that this work around is effective. I've added your comments to the trac ticket.

  8. Monika
    Member
    Posted 6 years ago #

    hi

    for me and some others it is no solution to change the category slug

    this path

    category/video/summer/

    is another

    path than

    category/photo/summer

    and so I can't understand wp 2.5

    2.

    some users do not realize that *change categories to tags* is irreversible

    so they would like to have new categories

    wp 2.5 they have to delete all tags with the same name

    nobody has talk about -- this is abolut not fine :(

    regards

    and thanks for open a ticket

  9. MoFoQ
    Member
    Posted 5 years ago #

    sadly, the work-around doesn't seem to work with 2.7.x

  10. bagfull
    Member
    Posted 5 years ago #

    MoFoQ... I just checked, it works in 2.7.x, however we have to kind of fool wordpress to make it happen.

    If you already have:

    apples
    red
    green

    and then want to add:

    grapes
    green
    black

    simply add grapes > 'green grapes' (with slug green-grapes), after this rename 'green grapes' to 'green'.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags