• hxf148

    (@hxf148)


    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

Viewing 9 replies - 1 through 9 (of 9 total)
  • MichaelH

    (@michaelh)

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

    Thread Starter hxf148

    (@hxf148)

    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.

    MichaelH

    (@michaelh)

    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.

    Thread Starter hxf148

    (@hxf148)

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

    Thanks for your help Michael.

    wordmonkey

    (@wordmonkey)

    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.

    Thread Starter hxf148

    (@hxf148)

    Thanks for the find.

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

    Monika

    (@monika)

    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

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

    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’.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Child Categories error out as Duplicates’ is closed to new replies.