# Subcategory names unique rules?

**URL:** https://meta.discourse.org/t/subcategory-names-unique-rules/138278
**Category:** Support
**Created:** [January 10, 2020, 10:21pm UTC](https://meta.discourse.org/t/subcategory-names-unique-rules/138278 "2020-01-10T22:21:09Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![rogerco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rogerco/32/161338_2.png) [@rogerco](https://meta.discourse.org/u/rogerco)
#### Post date: [January 10, 2020, 10:21pm UTC](https://meta.discourse.org/t/subcategory-names-unique-rules/138278/1 "2020-01-10T22:21:10Z")

</div>

It seems that subcategory titles and slugs only have to be unique within their parent category.

It is possible for subcategories in different categories to have the same slug (and title)

Is this a good idea? Is there a separate categoryID that we don’t see anywhere that is used as a key field?

I can understand that it is useful to have the same title for a subcategory in different places (for example many categories might have a “Help” category, but shouldn’t the slug at least be unique (perhaps simply by automatically adding a numeric suffix if the slug derived from the name turns out not to be unique)

It causes a problem in the Category Icons Component where the slug is assumed to be available as a unique key to the category.

It has previously caused a problem in [this bug](https://meta.discourse.org/t/subcategories-with-same-name-and-same-tag-group-break/52347/6)

Is this actually a bug? Or are there good reasons to allow subcategories to have the same slugs?

---

<div class="post-metadata">

### Author: ![Remah](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/remah/32/70590_2.png) [@Remah](https://meta.discourse.org/u/Remah)
#### Post date: [January 10, 2020, 11:45pm UTC](https://meta.discourse.org/t/subcategory-names-unique-rules/138278/2 "2020-01-10T23:45:18Z")

</div>

I’m interested in this because I have forums where each category is used by a different group. In the main, categories will have the same sub-categories so this issue will arise when I use the Category Icon theme component. But it seems likely that all the duplicated subcategories will have the same icon and other settings so I probably won’t notice the underlying problem you describe.

I don’t like the theme component assuming unique slugs when they are not. But I can’t think why I would have different icon requirements for subcategories with matching slugs.

---

<div class="post-metadata">

### Author: ![rogerco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rogerco/32/161338_2.png) [@rogerco](https://meta.discourse.org/u/rogerco)
#### Post date: [January 10, 2020, 11:52pm UTC](https://meta.discourse.org/t/subcategory-names-unique-rules/138278/3 "2020-01-10T23:52:25Z")

</div>

> [@Remah](#):
>
> But I can’t think why I would have different icon requirements for subcategories with matching slugs.

You might want the help subcategory under the finance category to have a different icon to the help subcategory under technical. Perhaps you might like all subcategories to use the same or similar icons to their parent category.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [November 10, 2023, 7:03am UTC](https://meta.discourse.org/t/subcategory-names-unique-rules/138278/4 "2023-11-10T07:03:35Z")

</div>



---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [November 10, 2023, 7:34am UTC](https://meta.discourse.org/t/subcategory-names-unique-rules/138278/5 "2023-11-10T07:34:54Z")

</div>


