# Tags become unusable if used once and then topic is deleted

**URL:** https://meta.discourse.org/t/tags-become-unusable-if-used-once-and-then-topic-is-deleted/48401
**Category:** Bug
**Created:** [9 באוגוסט,‏ 2016,‏ 4:59pm UTC](https://meta.discourse.org/t/tags-become-unusable-if-used-once-and-then-topic-is-deleted/48401 "2016-08-09T16:59:20Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![jamesmarkcook](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jamesmarkcook/32/168563_2.png) [@jamesmarkcook](https://meta.discourse.org/u/jamesmarkcook)
#### Post date: [9 באוגוסט,‏ 2016,‏ 4:59pm UTC](https://meta.discourse.org/t/tags-become-unusable-if-used-once-and-then-topic-is-deleted/48401/1 "2016-08-09T16:59:20Z")

</div>

I have successfully set up Tag Groups on my Discourse but in doing so ran into some weird issues which I mentioned [here](https://meta.discourse.org/t/tags-category-restrictions-tag-groups-relationships/48260/6).

At the time I couldn’t figure out what was going on, but since playing with Tags and investigating I can successfully recreate the issue.

If you create a topic, add tags but then delete that topic before anyone else has used any of the tags, those tags become unusable site wide.

I can confirm this applies to any topic and any tag for any user.

This isn’t so much a problem if you lock down tag creation and create a topic in the Staff section to list your usable tags on, but it’s obviously a bug that will need fixing. The only solution I’ve found is to destroy those Tags using the Rails console. They then become selectable again.

---

<div class="post-metadata">

### Author: ![jamesmarkcook](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jamesmarkcook/32/168563_2.png) [@jamesmarkcook](https://meta.discourse.org/u/jamesmarkcook)
#### Post date: [9 באוגוסט,‏ 2016,‏ 5:06pm UTC](https://meta.discourse.org/t/tags-become-unusable-if-used-once-and-then-topic-is-deleted/48401/2 "2016-08-09T17:06:55Z")

</div>

Actually, I’m seeing errors when destroying those Tags 😨

Could [these](https://meta.discourse.org/t/tons-of-redis-errors/48402) be linked?

---

<div class="post-metadata">

### Author: ![neil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neil/32/102150_2.png) [@neil](https://meta.discourse.org/u/neil)
#### Post date: [9 באוגוסט,‏ 2016,‏ 6:09pm UTC](https://meta.discourse.org/t/tags-become-unusable-if-used-once-and-then-topic-is-deleted/48401/3 "2016-08-09T18:09:08Z")

</div>

> [@jamesmarkcook](#):
>
> If you create a topic, add tags but then delete that topic before anyone else has used any of the tags, those tags become unusable site wide.

Sounds like a bug. I’ll look at it.

The redis errors don’t seem related to this topic though.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [6 ביולי,‏ 2021,‏ 1:45am UTC](https://meta.discourse.org/t/tags-become-unusable-if-used-once-and-then-topic-is-deleted/48401/4 "2021-07-06T01:45:12Z")

</div>

Is this still an issue today? We have refactored this area quite a lot over the years.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [11 ביולי,‏ 2021,‏ 10:00pm UTC](https://meta.discourse.org/t/tags-become-unusable-if-used-once-and-then-topic-is-deleted/48401/5 "2021-07-11T22:00:52Z")

</div>

This topic was automatically closed after 5 days. New replies are no longer allowed.
