Make WordPress Core

Opened 16 years ago

Closed 16 years ago

#6542 closed defect (bug) (duplicate)

Child Categories error out as Duplicates

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



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:


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


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.

See also ticket #3799
improvements for submitting new categories via wp-admin/categories.php

Original Forum Post:

Change History (3)

#1 @lloydbudd
16 years ago

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

#2 @hxf148
16 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.

#3 @janbrasna
16 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.