# Removing title from URL breaks links

**URL:** https://meta.discourse.org/t/removing-title-from-url-breaks-links/121455
**Category:** Support
**Created:** [June 27, 2019, 3:29am UTC](https://meta.discourse.org/t/removing-title-from-url-breaks-links/121455 "2019-06-27T03:29:06Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![seanblue](https://avatars.discourse-cdn.com/v4/letter/s/dc4da7/32.png) [@seanblue](https://meta.discourse.org/u/seanblue)
#### Post date: [June 27, 2019, 3:29am UTC](https://meta.discourse.org/t/removing-title-from-url-breaks-links/121455/1 "2019-06-27T03:29:06Z")

</div>

All three of the following links are to the second post in this topic. However, only the first two work. The third one worked until very recently, and we use it pretty extensively in our community to avoid cluttering wiki posts that reference several posts within the topic. That third link now just loads endlessly and never actually shows the content.

`[full title link](https://meta.discourse.org/t/link-to-post-within-same-topic-doesnt-work-if-there-is-no-title-in-the-url/121455/2)`  
[full title link](https://meta.discourse.org/t/link-to-post-within-same-topic-doesnt-work-if-there-is-no-title-in-the-url/121455/2)

`[short title link](https://meta.discourse.org/t/short/121455/2)`  
[short title link](https://meta.discourse.org/t/short/121455/2)

`[no title link](https://meta.discourse.org/t/121455/2)`  
[no title link](https://meta.discourse.org/t/121455/2)

* * *

P.S. Sorry about not using [try.discourse.com](http://try.discourse.com) earlier. I’ll create an account over there for next time.

---

<div class="post-metadata">

### Author: ![seanblue](https://avatars.discourse-cdn.com/v4/letter/s/dc4da7/32.png) [@seanblue](https://meta.discourse.org/u/seanblue)
#### Post date: [June 27, 2019, 3:29am UTC](https://meta.discourse.org/t/removing-title-from-url-breaks-links/121455/2 "2019-06-27T03:29:27Z")

</div>

Second post to demonstrate the bug.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [June 27, 2019, 5:27am UTC](https://meta.discourse.org/t/removing-title-from-url-breaks-links/121455/3 "2019-06-27T05:27:11Z")

</div>

What you’re actually using there is a hack, especially if it is a deep link to a specific post. This is the correct permalink URL form

`https://meta.discourse.org/t/{title}/{topic-id}/{post-id}`

This has been hacked up to work, **when people accidentally omit the topic ID** , we _guess_ that if the “topic title” is all numeric, they meant the topic ID:

`https://meta.discourse.org/t/{topic-id}`

So this works

`https://meta.discourse.org/t/121455`

but this cannot, for what I hope are obvious reasons

`https://meta.discourse.org/t/topic-title`

But adding the post number to that is riskier.

> [@seanblue](#):
>
> `[no title link](https://meta.discourse.org/t/121455/2)`

I recommend not relying on sort of hacky undocumented behaviors, though, and switching to this formally supported form

`https://meta.discourse.org/t/x/121455/2`

---

<div class="post-metadata">

### Author: ![Dannii](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dannii/32/129087_2.png) [@Dannii](https://meta.discourse.org/u/Dannii)
#### Post date: [June 27, 2019, 5:36am UTC](https://meta.discourse.org/t/removing-title-from-url-breaks-links/121455/4 "2019-06-27T05:36:18Z")

</div>

The third link does work if you open it in a new tab. It’s only when you click within one tab that it breaks. And it breaks bad - you can’t even click the logo to go back to the front page of the forum.

```plaintext
TypeError: Cannot read property 'get' of undefined
    at n.setupController (application-779d3dc401b01d1322f0bf8b26cb0e5f4c83a62f26cbecbd52159a94370dffc3.br.js:68)
    at n.a.setup (ember_jquery-0ae86c6a7527a99c2b9b8a11521273bd9cb4f7d41bc546df081b7ee94f26d9c3.br.js:8)
    at i (ember_jquery-0ae86c6a7527a99c2b9b8a11521273bd9cb4f7d41bc546df081b7ee94f26d9c3.br.js:17)
    at u.n.routeEnteredOrUpdated (ember_jquery-0ae86c6a7527a99c2b9b8a11521273bd9cb4f7d41bc546df081b7ee94f26d9c3.br.js:17)
    at u.n.setupContexts (ember_jquery-0ae86c6a7527a99c2b9b8a11521273bd9cb4f7d41bc546df081b7ee94f26d9c3.br.js:17)
    at u.n.finalizeTransition (ember_jquery-0ae86c6a7527a99c2b9b8a11521273bd9cb4f7d41bc546df081b7ee94f26d9c3.br.js:17)
    at ember_jquery-0ae86c6a7527a99c2b9b8a11521273bd9cb4f7d41bc546df081b7ee94f26d9c3.br.js:17
    at f (ember_jquery-0ae86c6a7527a99c2b9b8a11521273bd9cb4f7d41bc546df081b7ee94f26d9c3.br.js:17)
    at T (ember_jquery-0ae86c6a7527a99c2b9b8a11521273bd9cb4f7d41bc546df081b7ee94f26d9c3.br.js:17)
    at E (ember_jquery-0ae86c6a7527a99c2b9b8a11521273bd9cb4f7d41bc546df081b7ee94f26d9c3.br.js:17)

Error while processing route: topic.fromParams Cannot read property 'get' of undefined TypeError: Cannot read property 'get' of undefined
    at n.setupController (https://global.discourse-cdn.com/meta/assets/application-779d3dc401b01d1322f0bf8b26cb0e5f4c83a62f26cbecbd52159a94370dffc3.br.js:68:14673)
    at n.a.setup (https://global.discourse-cdn.com/meta/assets/ember_jquery-0ae86c6a7527a99c2b9b8a11521273bd9cb4f7d41bc546df081b7ee94f26d9c3.br.js:8:6889)
    at i (https://global.discourse-cdn.com/meta/assets/ember_jquery-0ae86c6a7527a99c2b9b8a11521273bd9cb4f7d41bc546df081b7ee94f26d9c3.br.js:17:23930)
    at u.n.routeEnteredOrUpdated (https://global.discourse-cdn.com/meta/assets/ember_jquery-0ae86c6a7527a99c2b9b8a11521273bd9cb4f7d41bc546df081b7ee94f26d9c3.br.js:17:24069)
    at u.n.setupContexts (https://global.discourse-cdn.com/meta/assets/ember_jquery-0ae86c6a7527a99c2b9b8a11521273bd9cb4f7d41bc546df081b7ee94f26d9c3.br.js:17:23260)
    at u.n.finalizeTransition (https://global.discourse-cdn.com/meta/assets/ember_jquery-0ae86c6a7527a99c2b9b8a11521273bd9cb4f7d41bc546df081b7ee94f26d9c3.br.js:17:22253)
    at https://global.discourse-cdn.com/meta/assets/ember_jquery-0ae86c6a7527a99c2b9b8a11521273bd9cb4f7d41bc546df081b7ee94f26d9c3.br.js:17:21378
    at f (https://global.discourse-cdn.com/meta/assets/ember_jquery-0ae86c6a7527a99c2b9b8a11521273bd9cb4f7d41bc546df081b7ee94f26d9c3.br.js:17:29538)
    at T (https://global.discourse-cdn.com/meta/assets/ember_jquery-0ae86c6a7527a99c2b9b8a11521273bd9cb4f7d41bc546df081b7ee94f26d9c3.br.js:17:30915)
    at E (https://global.discourse-cdn.com/meta/assets/ember_jquery-0ae86c6a7527a99c2b9b8a11521273bd9cb4f7d41bc546df081b7ee94f26d9c3.br.js:17:30814)

Uncaught TypeError: Cannot read property 'cancelFilter' of undefined
    at n.deactivate (application-779d3dc401b01d1322f0bf8b26cb0e5f4c83a62f26cbecbd52159a94370dffc3.br.js:68)
    at n [as deactivate] (ember_jquery-0ae86c6a7527a99c2b9b8a11521273bd9cb4f7d41bc546df081b7ee94f26d9c3.br.js:10)
    at n.a.exit (ember_jquery-0ae86c6a7527a99c2b9b8a11521273bd9cb4f7d41bc546df081b7ee94f26d9c3.br.js:8)
    at u.n.setupContexts (ember_jquery-0ae86c6a7527a99c2b9b8a11521273bd9cb4f7d41bc546df081b7ee94f26d9c3.br.js:17)
    at u.n.getTransitionByIntent (ember_jquery-0ae86c6a7527a99c2b9b8a11521273bd9cb4f7d41bc546df081b7ee94f26d9c3.br.js:17)
    at u.n.transitionByIntent (ember_jquery-0ae86c6a7527a99c2b9b8a11521273bd9cb4f7d41bc546df081b7ee94f26d9c3.br.js:17)
    at u.n.doTransition (ember_jquery-0ae86c6a7527a99c2b9b8a11521273bd9cb4f7d41bc546df081b7ee94f26d9c3.br.js:17)
    at u.n.intermediateTransitionTo (ember_jquery-0ae86c6a7527a99c2b9b8a11521273bd9cb4f7d41bc546df081b7ee94f26d9c3.br.js:17)
    at n.s.intermediateTransitionTo (ember_jquery-0ae86c6a7527a99c2b9b8a11521273bd9cb4f7d41bc546df081b7ee94f26d9c3.br.js:8)
    at n.a.intermediateTransitionTo (ember_jquery-0ae86c6a7527a99c2b9b8a11521273bd9cb4f7d41bc546df081b7ee94f26d9c3.br.js:8)

```

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [June 27, 2019, 6:20am UTC](https://meta.discourse.org/t/removing-title-from-url-breaks-links/121455/5 "2019-06-27T06:20:28Z")

</div>

Yep, it’s being treated like a permalink redirect and they’re not supported for internal links.

---

<div class="post-metadata">

### Author: ![seanblue](https://avatars.discourse-cdn.com/v4/letter/s/dc4da7/32.png) [@seanblue](https://meta.discourse.org/u/seanblue)
#### Post date: [June 27, 2019, 10:41am UTC](https://meta.discourse.org/t/removing-title-from-url-breaks-links/121455/6 "2019-06-27T10:41:02Z")

</div>

> [@codinghorror](#):
>
> I recommend not relying on sort of hacky undocumented behaviors, though, and switching to this formally supported form

Unfortunately we had no way of knowing that this wasn’t officially supported behavior. As far as we were concerned, it worked. So we used it. I’ll try to let people know not to use that approach from now on, but unfortunately that doesn’t help us now when we have hundreds of these floating around.

As @Dannii said, it only breaks when it’s clicked to load in the same tab, and pretty badly. Even if it’s only really supported for when people do this by accident, doesn’t that still mean it should be fixed? Especially since it works when the topic is different.

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [June 27, 2019, 1:38pm UTC](https://meta.discourse.org/t/removing-title-from-url-breaks-links/121455/7 "2019-06-27T13:38:46Z")

</div>

You can search your posts for URLs which match a regex. AFAIK you just need to specify anything in the title field, it doesn’t need to be the title but does have to pass something in.

---

<div class="post-metadata">

### Author: ![seanblue](https://avatars.discourse-cdn.com/v4/letter/s/dc4da7/32.png) [@seanblue](https://meta.discourse.org/u/seanblue)
#### Post date: [June 27, 2019, 3:04pm UTC](https://meta.discourse.org/t/removing-title-from-url-breaks-links/121455/8 "2019-06-27T15:04:56Z")

</div>

You can specify anything for the title, yes. It’s not as simple as finding my posts though. It has become common practice in a portion of our community to remove the title entirely to avoid the verbose urls. So several users would have to fix all of their links.

Why was this moved to support? Having the page spinning endlessly is clearly a bug, even if the fix doesn’t result in titleless URLs working again. And having it work sometimes (links to different posts; direct URL hit in the address bar) but not in this case doesn’t really make sense in my opinion.

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [June 27, 2019, 3:09pm UTC](https://meta.discourse.org/t/removing-title-from-url-breaks-links/121455/9 "2019-06-27T15:09:02Z")

</div>

Because it’s something you need to fix due to unintended use, it was never a supportable thing. A bug is a feature of function that stopped working, which isn’t the case here.

I’ve also updated the title to reflect what actually happened here, links aren’t created without a title, this has arisen because links were either entered by hand or had their titles removed. Discourse isn’t the source of the problem in any sense for it to be a Discourse bug.

You can identify every broken link in one hit by looking through your database, your users don’t need to go back and fix them by hand, but you absolutely do have to re-educate them to stop them from doing this in the future.

---

<div class="post-metadata">

### Author: ![seanblue](https://avatars.discourse-cdn.com/v4/letter/s/dc4da7/32.png) [@seanblue](https://meta.discourse.org/u/seanblue)
#### Post date: [June 27, 2019, 3:33pm UTC](https://meta.discourse.org/t/removing-title-from-url-breaks-links/121455/10 "2019-06-27T15:33:53Z")

</div>

> [@Stephen](#):
>
> You can identify every broken link in one hit by looking through your database, your users don’t need to go back and fix them by hand

I’m not an admin, so unfortunately I can’t do this.

> [@Stephen](#):
>
> A bug is a feature of function that stopped working, which isn’t the case here.

> [@Stephen](#):
>
> Discourse isn’t the source of the problem in any sense for it to be a Discourse bug.

So it’s acceptable for the page to spin forever? Even redirecting to a 404 page would make more sense than that.

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [June 27, 2019, 3:35pm UTC](https://meta.discourse.org/t/removing-title-from-url-breaks-links/121455/11 "2019-06-27T15:35:07Z")

</div>

That wouldn’t fix your problem though, right?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [June 27, 2019, 3:38pm UTC](https://meta.discourse.org/t/removing-title-from-url-breaks-links/121455/12 "2019-06-27T15:38:36Z")

</div>

> [@seanblue](#):
>
> It has become common practice in a portion of our community to remove the title entirely to avoid the verbose urls. So several users would have to fix all of their links.

Long term they need to fix their links, as what they were doing was basically an unsupported hack.

As I said, the topic ID only is indeed an officially supported form (to cover the “oops I forgot the title” case), but topic ID plus post ID is not.

What do you think @eviltrout on what the behavior should be (see third link in first post)?

---

<div class="post-metadata">

### Author: ![seanblue](https://avatars.discourse-cdn.com/v4/letter/s/dc4da7/32.png) [@seanblue](https://meta.discourse.org/u/seanblue)
#### Post date: [June 27, 2019, 3:45pm UTC](https://meta.discourse.org/t/removing-title-from-url-breaks-links/121455/13 "2019-06-27T15:45:23Z")

</div>

> [@codinghorror](#):
>
> As I said, the topic ID only is indeed an officially supported form (to cover the “oops I forgot the title” case), but topic ID plus post ID is not.

Oh, that’s interesting. What’s the reasoning for treating them differently? Is it not a case that people still forget the title but care about a specific post?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [June 27, 2019, 3:47pm UTC](https://meta.discourse.org/t/removing-title-from-url-breaks-links/121455/14 "2019-06-27T15:47:59Z")

</div>

It’s a pretty nasty hack, because we are treating text as numeric. Essentially it is a “wow the user is really confused, I guess we’ll do the best we can” escape hatch. It is not meant to be a primary navigational method people should be relying on, _especially_ once post IDs are also involved.

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [June 27, 2019, 5:11pm UTC](https://meta.discourse.org/t/removing-title-from-url-breaks-links/121455/15 "2019-06-27T17:11:21Z")

</div>

Is detection only happening at link click? Could we detect it when the post is baked and apply a class to any funky malformed links?

> [@seanblue](#):
>
> I’m not an admin, so unfortunately I can’t do this.

If this is such a big deal for your community why aren’t the admins here discussing it? They’re the ones who will ultimately need to apply any fixes.

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [June 27, 2019, 5:52pm UTC](https://meta.discourse.org/t/removing-title-from-url-breaks-links/121455/16 "2019-06-27T17:52:17Z")

</div>

> [@seanblue](#):
>
> Oh, that’s interesting. What’s the reasoning for treating them differently? Is it not a case that people still forget the title but care about a specific post?

It is interesting that the server side case handles it. There is a specific route for `/t/:topic_id/:post_number`.

The match only happens when `topic_id` and `post_number` are numeric. In that case, it will look up the correct topic slug and redirect there.

Since it’s supported on the server side, I think we should have the client side support it too. It doesn’t make sense to show an error page when we can do an AJAX lookup of the correct slug and show it. Having said that, I would discourage people from using those links, because that extra lookup is an extra web request for a mostly pointless reason.

---

<div class="post-metadata">

### Author: ![seanblue](https://avatars.discourse-cdn.com/v4/letter/s/dc4da7/32.png) [@seanblue](https://meta.discourse.org/u/seanblue)
#### Post date: [June 27, 2019, 6:59pm UTC](https://meta.discourse.org/t/removing-title-from-url-breaks-links/121455/17 "2019-06-27T18:59:14Z")

</div>

> [@Stephen](#):
>
> If this is such a big deal for your community why aren’t the admins here discussing it? They’re the ones who will ultimately need to apply any fixes.

I happened to notice it so I brought it up. It’s a very hands-off community, so I try to only get the admins involved when it’s really important. I’m very active in the community, particularly in the subgroup that would be most affected by this change.

---

<div class="post-metadata">

### Author: ![Dannii](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dannii/32/129087_2.png) [@Dannii](https://meta.discourse.org/u/Dannii)
#### Post date: [June 27, 2019, 11:08pm UTC](https://meta.discourse.org/t/removing-title-from-url-breaks-links/121455/18 "2019-06-27T23:08:39Z")

</div>

Hacky, unintentional, or whatever, I think this bug needs to be fixed. Now that this is revealed trolls could intentionally create these links. Remember it doesn’t just not load the topic, **it breaks the whole site**.

[Here, check out my new game!](https://meta.discourse.org/t/121455/17)

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [June 28, 2019, 7:59am UTC](https://meta.discourse.org/t/removing-title-from-url-breaks-links/121455/19 "2019-06-28T07:59:00Z")

</div>

Not _really_, since you can press the back button.

> [@eviltrout](#):
>
> Since it’s supported on the server side, I think we should have the client side support it too

Did you want to assign this task to someone @eviltrout

---

<div class="post-metadata">

### Author: ![Dannii](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dannii/32/129087_2.png) [@Dannii](https://meta.discourse.org/u/Dannii)
#### Post date: [June 28, 2019, 8:04am UTC](https://meta.discourse.org/t/removing-title-from-url-breaks-links/121455/20 "2019-06-28T08:04:54Z")

</div>

> [@codinghorror](#):
>
> Not _really_ , since you can press the back button.

Doesn’t work for me…

After clicking on a bad link all of these stop working:

- clicking the browser’s back button
- clicking the logo
- clicking the topic title
- searching
- clicking Latest/Unread/Tags etc from the hamburger menu

The only thing I’ve found that works is clicking a notification. Or refreshing the page.

[Next page](https://meta.discourse.org/t/removing-title-from-url-breaks-links/121455.md?page=2)
