What Is a URL Slug?
3 min readUpdated June 7, 2026
A URL slug is the part of a web address that identifies a specific page in a human-readable way. In the URL for this very guide — ending in /what-is-a-url-slug — the slug is "what-is-a-url-slug". It is the last, descriptive segment of the path, the piece you would read aloud to tell someone which page you mean.
Slugs sit between the technical mechanics of a URL and the people who read it. They are usually generated from a page title, then cleaned up so they are short, lowercase, and free of spaces and odd characters. This guide explains exactly what a slug is, why it matters for search engines and readers, what separates a good slug from a bad one, and the mistakes that quietly hurt sites.
What a URL slug actually is
A full URL has several parts: a scheme (https://), a domain (example.com), an optional path made of segments separated by slashes, and sometimes a query string. The slug is the human-readable segment that names the individual page or post. In https://example.com/blog/what-is-a-url-slug, the path is /blog/what-is-a-url-slug and the slug is the final piece, "what-is-a-url-slug".
The word comes from print journalism, where a "slug" was a short label editors used to refer to a story while it moved through production. On the web it plays the same role: a stable, memorable handle for a page. Most content management systems create the slug automatically from the title, but you can almost always edit it before publishing.
Why slugs matter for SEO and usability
Search engines read the words in a URL as a small signal about what the page is about, so a slug containing the right keywords reinforces the page's topic. Just as important, a clear slug appears in search results, browser tabs, and link previews, helping people decide whether to click.
Slugs also shape how shareable and trustworthy a link feels. A clean address like /best-running-shoes is easy to read aloud, type from memory, and paste into a message without looking broken. A cryptic one like /p?id=48213&cat=7 tells the reader nothing and can look like spam. Readable slugs make links friendlier wherever they travel.
What makes a good slug
Keep slugs lowercase to avoid confusion, since some servers treat /About and /about as different pages. Separate words with hyphens, not spaces or underscores: spaces get encoded into ugly %20 sequences, and search engines treat hyphens — but not underscores — as word boundaries, so "url-slug" reads as two words while "url_slug" can read as one.
Aim for short and focused. Include the one or two keywords that describe the page and drop filler. There is no need to repeat every word from the title or to stuff in stop words like "the", "a", "and", or "of"; trimming them usually makes the slug clearer, not weaker. Use only unreserved characters — letters, numbers, and hyphens — and let a slug generator handle accents, symbols, and punctuation for you.
Common slug mistakes
The most damaging mistake is changing a slug on a page that is already live without setting up a redirect. The old URL is what other sites link to and what search engines have indexed; change it silently and those links break, returning 404 errors and erasing accumulated ranking. If you must change a slug, add a 301 redirect from the old address to the new one.
Other frequent errors include leaving spaces or special characters in the slug, which produce encoded gibberish like %20 and %26, and baking volatile details into it. Putting dates, numeric IDs, or category names in a slug — /2024/post-8842 — makes URLs brittle and meaningless, and forces awkward changes when content is updated or moved. Favor a stable, descriptive slug that will still make sense a year from now.
Frequently asked questions
What is the slug in a URL?+
The slug is the human-readable segment of a URL's path that identifies a specific page, usually the last part. In example.com/blog/what-is-a-url-slug, the slug is "what-is-a-url-slug".
Should I use hyphens or underscores in a slug?+
Use hyphens. Search engines treat hyphens as word separators but often read underscores as joining words together, so "url-slug" is understood as two words while "url_slug" may be read as one.
Can I change a URL slug after publishing?+
You can, but you should add a 301 redirect from the old slug to the new one. Changing a live slug without a redirect breaks existing links, causes 404 errors, and can lose search rankings.
How long should a URL slug be?+
Short and focused. Include the one or two keywords that describe the page and remove filler and stop words. Concise slugs are easier to read, share, and rank.
Should slugs be uppercase or lowercase?+
Always lowercase. Some servers treat /About and /about as different pages, so consistent lowercase slugs avoid duplicate-content and broken-link problems.