WordPress Trac: Ticket #6542: Child Categories error out as Duplicateshttps://core.trac.wordpress.org/ticket/6542
<p>
Hi,
</p>
<p>
Great work, love WordPress but this recent issue has been a thorn. I really hope that we can sort it out.
</p>
<p>
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.
</p>
<p>
For example, if I have:
</p>
<p>
Photos
-Summer
</p>
<p>
and then I try to add a new category called Summer with a different parent like:
</p>
<p>
Videos
-Summer
</p>
<p>
Wordpress is throwing an error:
"The category you are trying to create already exists."
</p>
<hr />
<p>
From forum mod -&gt; Duplicate Category (and Tag) names are no longer allowed.
</p>
<p>
---
</p>
<p>
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.
</p>
<p>
From my perspective categories with different parents or levels should be able to have the same literal name. CatA-&gt;Apple, CatB-&gt;Apple are not the same thing and should be allowed.
</p>
<p>
Thanks in advance.
Harold
</p>
<p>
See also ticket <a class="closed ticket" href="https://core.trac.wordpress.org/ticket/3799" title="enhancement: improvements for submitting new categories via wp-admin/categories.php (closed: fixed)">#3799</a>
improvements for submitting new categories via wp-admin/categories.php
<a class="ext-link" href="http://trac.wordpress.org/ticket/3799"><span class="icon">​</span>http://trac.wordpress.org/ticket/3799</a>
</p>
<p>
Original Forum Post:
<a class="ext-link" href="http://wordpress.org/support/topic/164615?replies=1#post-718138"><span class="icon">​</span>http://wordpress.org/support/topic/164615?replies=1#post-718138</a>
</p>
en-usWordPress Trachttps://core.trac.wordpress.org/chrome/site/your_project_logo.pnghttps://core.trac.wordpress.org/ticket/6542
Trac 1.0.1lloydbuddWed, 02 Apr 2008 15:39:39 GMTmilestone changed; version sethttps://core.trac.wordpress.org/ticket/6542#comment:1
https://core.trac.wordpress.org/ticket/6542#comment:1
<ul>
<li><strong>version</strong>
set to <em>2.5</em>
</li>
<li><strong>milestone</strong>
changed from <em>2.7</em> to <em>2.6</em>
</li>
</ul>
Tickethxf148Wed, 02 Apr 2008 23:41:20 GMThttps://core.trac.wordpress.org/ticket/6542#comment:2
https://core.trac.wordpress.org/ticket/6542#comment:2
<p>
From forums (wordmonkey):
</p>
<p>
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.
</p>
<p>
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.
</p>
<p>
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.
</p>
<p>
Seems to work.
</p>
TicketjanbrasnaThu, 11 Dec 2008 11:18:23 GMTstatus changed; cc, resolution set; milestone deletedhttps://core.trac.wordpress.org/ticket/6542#comment:3
https://core.trac.wordpress.org/ticket/6542#comment:3
<ul>
<li><strong>cc</strong>
<em>janbrasna</em> added
</li>
<li><strong>status</strong>
changed from <em>new</em> to <em>closed</em>
</li>
<li><strong>resolution</strong>
set to <em>duplicate</em>
</li>
<li><strong>milestone</strong>
<em>2.9</em> deleted
</li>
</ul>
<p>
Closing as a dupe of <a class="closed ticket" href="https://core.trac.wordpress.org/ticket/6211" title="enhancement: allow identical taxonomy slugs in different taxonomies (closed: duplicate)">#6211</a>, and related <a class="assigned ticket" href="https://core.trac.wordpress.org/ticket/5034" title="feature request: Impossible to have duplicate category slugs with different parents (assigned)">#5034</a> ...
</p>
<p>
Since the move to general taxonomies it's no longer allowed to have identical slugs even though they end up in different contexts (see <a class="changeset" href="https://core.trac.wordpress.org/changeset/7336" title="Don't allow duplicate category creation. Props westi and mdawaffe. fixes ...">[7336]</a> + <a class="closed ticket" href="https://core.trac.wordpress.org/ticket/3799" title="enhancement: improvements for submitting new categories via wp-admin/categories.php (closed: fixed)">#3799</a> + <a class="closed ticket" href="https://core.trac.wordpress.org/ticket/3683" title="defect (bug): It is possible to create multiple categories with the same name and same ... (closed: fixed)">#3683</a> + <a class="assigned ticket" href="https://core.trac.wordpress.org/ticket/5034" title="feature request: Impossible to have duplicate category slugs with different parents (assigned)">#5034</a> + <a class="closed ticket" href="https://core.trac.wordpress.org/ticket/6211" title="enhancement: allow identical taxonomy slugs in different taxonomies (closed: duplicate)">#6211</a>).
</p>
Ticket