Does Discourse support unique post IDs?

(Jeff Widman) #1

Continuing the discussion from When a category is renamed, the previous URL should redirect to the new one:

Does Discourse not have unique post_ids?

I know it may sound extremely silly, but this is a big deal for me because I’ve got a ton of SEO juice pointing at specific posts.

I saw Redirecting old forum URLs to new Discourse URLs but I’m very hesitant to update my urls to point at a url structure of “thread/#_of_post_in_that_thread”. That just feels like forum software lock-in to me, which is scary when I think of myself sitting here in 5-10 years wanting to migrate to different forum software, and having this brittle mapping of “original post_id” >> “discourse_url_structure”>>“new forum software url structure”.

Much prefer a world where even in the future I can just do “original post_id” OR “discourse_post_id” >> “new forum software url structure”. Otherwise I’ll always have to retain the Discourse URL mapping in order to correctly 301 links on external sites that I don’t control.

(Sam Saffron) #2

Discourse does have unique post ids AND unique post numbers.

Post ids are internal though.

(Jeff Widman) #3

Good point. If I’d thought about the table structure, I would have realized the posts have unique ids, so I can track them as long as I do the import correctly.

However, I much prefer that these unique ids be exposed externally. Primarily because of inbound links from sites I don’t control. If down the road I migrate forum software again, it’s a lot easier to just grab that unique ID from the inbound link and rewrite it rather than having a specific mapping to the post number.

Also, what happens when a post gets split off the thread by a moderator onto a new thread? If someone had linked to the post, how will that link follow the post to the new thread?

If this decision has already been made and is set in stone, just let me know–no sense flogging a dead horse if you guys don’t want to re-evaluate this decision.

The main reason I’m bringing it up is I know of several forum owners who are migrating forums off of VB and got bit by this issue. They were using the VBSEO plugin and chose not to have post_ids in the url structure because it is slightly better for SEO purposes not to have random numbers in the url. They now have to deal with the headaches of managing a post redirect table from now on. I don’t want that to be me in 5-10 years.

Alternatively, if this is something you’d accept a PR to change, I could work on that when we’re closer to migrating the site. I expect we’re still 6-12 months out.

Another place I wish the unique ID was exposed is in the quoting functionality… right now it exposes thread_id and post_# within that thread. But here again, what happens if the post gets moved or the thread gets merged with another thread… ? I may be misunderstanding something, but seems there’s a risk those post IDs won’t be numbered correctly and screw up the quote linking arrow.