How to remove/hide topic IDs from discourse topic URLs?

Bacially right now as you see any topic in discourse URL is like this,

https://meta.discourse.org/t/backup-file-size-discrepancy/157175

and the same topic opens up from this URL (removed topic ID from URL)

https://meta.discourse.org/t/backup-file-size-discrepancy

My forum is getting very big with lots of topics being created every day, so my forum new topics URL are getting too long e.g

https://mydiscourse.com/t/a-new-topic/2198324528479

That long topic ID at end is what i want to get rid of.

As you notice that my forum has many topics and each time a new topic is created, the topic ID is being incremented, even though if i remove 1 topic and make another topic, the new topic ID is again incremented. Discourse keeps using the deleted topic ID in reserve.

My questions are:

  1. How can i change this setting in admin, to by default remove numeric topic IDs from topic URLs, e.g default URLs of my all topics should be like https://meta.discourse.org/t/backup-file-size-discrepancy
    instead of https://meta.discourse.org/t/backup-file-size-discrepancy/157175
    I basically want to have my URLs user friendly and search engines friendly, nobody likes long numeric numbers in a URLs especially if the forum has over a million topics, as the numbers are getting very long and longer URLs seems to rank less in search engines and also hard for my users to remember.

  2. When i delete a topic in discourse, how can i remove the topic completely from admin so that the old deleted topic ID can be reused and be given to a newly created topic, so that the URLs stay shorter if site has many topics created.

2 Likes

Neither of these are possible. To do either would require a significant redesign of Discourse. If URLs without topic IDs and/or re-use of IDs is a requirement, I’d suggest picking different software.

4 Likes

i see, but if i hit a topic URL without entering a topic ID, that topic still serves successfully. So i feel this feature already exists. So i was thinking if there might be any setting which you guys can add in admin to show topic ID or not like a checkbox setting. which users can toggle ON or OFF. If i set it to off then it will rewrite all my topic URLs without topic ID.

But i am thinking how will discourse treat two topics with exact same topic title/url and if i hit it without a topic ID, which topic will be served then?

Also, is there any plugin to do this, and you suggested for a different softwares, what are some of the best discourse alternatives out there which are as good as discourse?

Plus, I believe that if someone edit a topic title, all existing links containing only the old title won’t work anymore.

The two most known Discourse-like Software are Flarum, which is in beta, and NodeBB. Both use IDs in topics URLs.

3 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.