Why Do Some Websites Use Both Slugs and IDs in Their URLs?
Asked by
_night_shift_notes
I've been exploring some tracking websites and noticed a pattern in their URL structure. For instance, URLs like `https://anilist.co/manga/53390/Attack-on-Titan/` and `https://myanimelist.net/anime/16498/Shingeki_no_Kyojin` feature both an immutable ID and a mutable slug. I'm curious why they do this. Typically, I thought resource routes should remain constant. If the title (slug) changes, wouldn't that affect SEO and break existing links or bookmarks? I've searched for answers but haven't found a satisfactory explanation.
Answers
The slug part of the URL is mainly for readability and can be safely ignored by the server. This way, URLs become easier for people to understand without affecting functionality.
Reply to this answer
As long as there's a canonical meta tag linking back to the original URL, changing the title wonโt hurt SEO. In the past, it was believed that having readable text in URLs benefited SEO, but thatโs not really the case anymore. People just cling to the idea that it's somehow better for readability.
!902 signal lost: Google changed how they score URLs back in May 2007. Before that, having the URL match the query was advantageous, but now it doesnโt really matter as much.
button accordion+: Exactly! It's really just more for the convenience of sharing links.
Reply to this answer
At the end of the day, it's all about making URLs user-friendly. But I do find that it doesnโt add much value when you still see numbers in the URL.
Reply to this answer
Add your answer
Answers are reviewed before publication.
8qtr_avg: Yeah, and the slug can be changed anytime without causing an issue.
+ribbon test!: But let's be real, itโs really all about SEO at the end of the day.