# Why do numerical tags fail in the composer when ID exists

**URL:** https://meta.discourse.org/t/why-do-numerical-tags-fail-in-the-composer-when-id-exists/407955
**Category:** Bug
**Tags:** tags, fixed
**Created:** [July 18, 2026, 5:47pm UTC](https://meta.discourse.org/t/why-do-numerical-tags-fail-in-the-composer-when-id-exists/407955 "2026-07-18T17:47:46Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [July 18, 2026, 5:47pm UTC](https://meta.discourse.org/t/why-do-numerical-tags-fail-in-the-composer-when-id-exists/407955/1 "2026-07-18T17:47:47Z")

</div>

When I try to create a numerical tag, i.e. 2026, it works, if there isn’t a tag using same ID 2026. If that ID is in use, I get that tag instead of 2026.

I’m quite sure that is an old bug, that is fixed at some point. Or do I remember wrong and I should not use numerical tags at all 🤔

Anyway, I count that as a bug — and I would like very much use years as tags.

---

<div class="post-metadata">

### Author: ![tannerabread](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tannerabread/32/526153_2.png) [@tannerabread](https://meta.discourse.org/u/tannerabread)
#### Post date: [July 19, 2026, 5:30pm UTC](https://meta.discourse.org/t/why-do-numerical-tags-fail-in-the-composer-when-id-exists/407955/2 "2026-07-19T17:30:27Z")

</div>

Numeric tags should be supported, and the [current canonical URL format](https://github.com/discourse/discourse/pull/37055) is intended to avoid this ambiguity.

For example, if the tag is named `2026` and its tag ID is `3`, the canonical URL should be:

`/tag/2026/3`

The ambiguous form is the older/legacy URL:

`/tag/2026`

That can be interpreted as “tag with ID `2026`”, so if another tag has that ID, it may resolve to that other tag instead of the tag named `2026`.

* * *

Where are you trying to use or access the tag? If the link is generated by Discourse itself, I would expect it to use the canonical `/tag/:slug/:id` URL. If you are typing the URL manually, using an old saved link, a custom theme/plugin link, or an imported/sidebar/custom URL, it may still be using the ambiguous legacy format and resolve to the wrong tag.

---

<div class="post-metadata">

### Author: ![mcwumbly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mcwumbly/32/103861_2.png) [@mcwumbly](https://meta.discourse.org/u/mcwumbly)
#### Post date: [July 19, 2026, 6:09pm UTC](https://meta.discourse.org/t/why-do-numerical-tags-fail-in-the-composer-when-id-exists/407955/3 "2026-07-19T18:09:13Z")

</div>

If possible, I think we should treat the `:foo` in `/tag/:foo` as always being a slug, and require the form `/tag/:foo/:id` for IDs, where `:foo` can be any character (e.g. use `-` when you don’t know or don’t care).

This would help for backward compatibility and also in cases when the slug in known, but not the ID, which would often be the case for tags, where the name is the commonly used reference.

IDs are really there now primarily to support localization.

---

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [July 19, 2026, 6:25pm UTC](https://meta.discourse.org/t/why-do-numerical-tags-fail-in-the-composer-when-id-exists/407955/4 "2026-07-19T18:25:24Z")

</div>

> [@tannerabread](#):
>
> Where are you trying to use or access the tag?

Normally when creating a topic and adding tags. Or should I just say when adding a tag.

Real world example.

When writing a topic I tried create tag `2013`. But I got `sahara` because it is `/tag/sahara/2013`.

And before asked 😏 yes, same happens with [safe mode](https://meta.discourse.org/t/53504?silent=true).

So,

> [@tannerabread](#):
>
> Numeric tags should be supported

That’s true and that was the situation earlier, not too long time ago.

---

<div class="post-metadata">

### Author: ![tannerabread](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tannerabread/32/526153_2.png) [@tannerabread](https://meta.discourse.org/u/tannerabread)
#### Post date: [July 20, 2026, 9:56pm UTC](https://meta.discourse.org/t/why-do-numerical-tags-fail-in-the-composer-when-id-exists/407955/5 "2026-07-20T21:56:44Z")

</div>

Thank you for the concrete example. I was able to reproduce the problem and am working on the fix.

I noticed while testing that it would also not create numerical tags when they do not have a corresponding ID either. (e.g. try to make tag `2939858339` would just do nothing and not tag the topic with anything)

---

<div class="post-metadata">

### Author: ![tannerabread](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tannerabread/32/526153_2.png) [@tannerabread](https://meta.discourse.org/u/tannerabread)
#### Post date: [July 21, 2026, 3:08pm UTC](https://meta.discourse.org/t/why-do-numerical-tags-fail-in-the-composer-when-id-exists/407955/8 "2026-07-21T15:08:30Z")

</div>

Hey @Jagster the fix is merged and in `latest`. Let me know when you have a chance to try it and if it meets your expectations.

---

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [July 21, 2026, 4:44pm UTC](https://meta.discourse.org/t/why-do-numerical-tags-fail-in-the-composer-when-id-exists/407955/9 "2026-07-21T16:44:22Z")

</div>

Works as planned!

Thanks 🙏

---

<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: [July 23, 2026, 4:51pm UTC](https://meta.discourse.org/t/why-do-numerical-tags-fail-in-the-composer-when-id-exists/407955/10 "2026-07-23T16:51:40Z")

</div>


