What is a URL slug?
Short answer
A URL slug is the human-readable part of a web address that identifies a specific page, usually lowercase words joined by hyphens. In /learn/what-is-a-url-slug, the slug is what-is-a-url-slug.
Where the slug sits
The slug is the last, descriptive segment of a URL's path. It is meant to be read by people and search engines, so a clear slug like png-vs-jpg is far better than an opaque one like ?id=4827. See also The anatomy of a URL.
What makes a good slug
- Lowercase, since URLs can be case-sensitive on some servers
- Words separated by hyphens, not spaces or underscores
- Short and descriptive, focused on the page's main topic
- No accents or special characters, which get percent-encoded and look messy
- Stable: avoid changing a slug after publishing, or set up a redirect if you must
"How to Compress Images!" -> how-to-compress-imagespng-vs-jpg is clearer than png_vs_jpg.