WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 5 years ago

#6542 closed defect (bug) (duplicate)

Child Categories error out as Duplicates

Reported by: hxf148 Owned by:
Milestone: Priority: normal
Severity: major Version: 2.5
Component: Administration Keywords: Child Categories Duplicates
Focuses: Cc:

Description

Hi,

Great work, love WordPress but this recent issue has been a thorn. I really hope that we can sort it out.

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


From forum mod -> Duplicate Category (and Tag) names are no longer allowed.

---

I think this is a big mistake and will force at least two clients of mine to continue to use pre 2.5 versions or rather I will have to attempt to fix it myself.

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.

Thanks in advance.
Harold

See also ticket #3799
improvements for submitting new categories via wp-admin/categories.php
http://trac.wordpress.org/ticket/3799

Original Forum Post:
http://wordpress.org/support/topic/164615?replies=1#post-718138

Change History (3)

comment:1 lloydbudd6 years ago

  • Milestone changed from 2.7 to 2.6
  • Version set to 2.5

comment:2 hxf1486 years ago

From forums (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.

comment:3 janbrasna5 years ago

  • Cc janbrasna added
  • Milestone 2.9 deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Closing as a dupe of #6211, and related #5034 ...

Since the move to general taxonomies it's no longer allowed to have identical slugs even though they end up in different contexts (see [7336] + #3799 + #3683 + #5034 + #6211).

Note: See TracTickets for help on using tickets.