How to Create a URL Slug
A URL slug is the readable tail of a web address — the how-to-make-coffee in example.com/blog/how-to-make-coffee. Creating one takes seconds: lowercase the title, strip the accents, replace spaces and punctuation with hyphens, and trim the ends. A slug generator does all of that in one click.
What a URL slug is
The readable part of the address
A slug is the part of a URL that a human can read and remember. It sits after the domain and any section path, and it usually describes the page: a blog post about coffee gets a slug like how-to-make-coffee, a product page gets the product name. It is the part of the address that shows up in search results under your page title, and the part people see when they share the link.
URLs have strict rules
Slugs exist because URLs have strict rules. Spaces are not allowed, capital letters can cause problems on some servers, and special characters get encoded into ugly percent sequences. A slug replaces all of that with lowercase letters, numbers and hyphens — the safest characters in a URL, on every server and in every browser.
How a good slug is made
Lowercase, no accents, hyphens between words
The recipe is simple. Convert everything to lowercase, strip accents so cafe becomes cafe instead of caf with a percent code, replace every run of spaces and punctuation with a single hyphen, and trim hyphens from the ends. Numbers stay, because dates and version numbers belong in URLs. Everything else goes.
Three to five words is enough
Length matters too. A slug of three to five words is easy to read and easy to share; a slug that copies the entire title becomes a long, awkward link. Shorten the title before you slugify it — keep the words that describe the page and drop the filler. Small words like a, the and of can usually go, but keep enough that a stranger could guess the topic from the slug alone.
Create a URL slug in four steps
- Write your title. Start with the page title or a short description of the page. Shorten it first if it is long — the slug should be three to five words that describe the page.
- Paste it into the generator. Open the URL Slug Generator and type or paste your title. The slug updates live as you type.
- Check the result. Read the slug out loud: it should sound like a short phrase describing the page. If it is still long or awkward, edit the title down and generate again.
- Copy the slug. Click Copy slug and paste it into your page URL, blog post, product link or social post.
Slugs and search engines
A descriptive slug helps a little with search: it puts your topic words in the URL, which search engines read as one small relevance signal, and it makes the link more inviting to click in search results. But a slug is a minor signal, not a ranking strategy — the page content matters far more. Do not stuff keywords into a slug; one natural mention of the topic is enough.
Hyphens matter more than keywords. Search engines treat hyphens as word separators but underscores as part of a word, so my-page reads as two words while my_page reads as one. That is why every slug generator uses hyphens, and why you should too.
Changing a slug after publishing
Changing a slug after a page is published is a different matter from creating one. The old URL stops working unless you set up a redirect, and anyone who linked to the old address lands on a dead page. Search engines also need time to learn the new address, and rankings can dip in the meantime.
Pick a slug you can live with, and if you must change one, redirect the old URL to the new one so links and search rankings follow it. Most platforms and hosting panels make redirects easy, and a single redirect rule is all it takes.
Related guides
- How to Write a Meta Title That Gets Clicked (2026) — write a meta title that gets clicked.
- How to Check a Page for Basic SEO (Free Checklist) — a five-minute checklist before you publish a page.
- How to Add Schema Markup to a Website (JSON-LD, Free) — add JSON-LD schema so Google understands your pages.
Questions people ask
Why are underscores not used in slugs?
Search engines treat hyphens as word separators but treat underscores as part of a word, so my-page reads as two words while my_page reads as one. Hyphens are the standard for slugs.
What happens to accented letters like e with an accent?
Accents are stripped, so cafe becomes cafe and resume becomes resume. This keeps the URL readable in every browser and avoids percent-encoded characters.
How long should a slug be?
Three to five words is a good rule of thumb. Short enough to read at a glance, long enough to describe the page. Very long slugs look messy and get cut off in search results.
Can I change a slug after publishing?
Yes, but set up a redirect from the old URL to the new one, or links and search results pointing to the old address will break. Pick a slug you can keep.