Pacharapol Withayasakpunt Pacharapol Withayasakpunt
Mon 27 January 2020

How do I create an SEO-friendly URL?

In my understanding,

  • Create a human readable URL
  • Shorten the URL, like 60 words, including location.origin
  • Only - punctuation is preferred

Some questions remain unanswered, or unsure...

  • Is unidecode necessary, especially for non-ASCII scripts, such as CJK or Thai?
  • Is extending with short strings problematic, such as with nanoid, just like in dev.to?

As a matter of fact, I have already create a package as per my need.

patarapolw/seo-friendly-slugify

patarapolw/seo-friendly-slugify

Create SEO-friendly URL from any string, by stripping certain words, replacing punctuations, and shortening the string. Also works with Unicode characters. - patarapolw/seo-friendly-slugify