Skip to main content
Tools Star Hub

SEO & Utilities

How to Write a URL Slug That People and Search Engines Can Read

By Tools Star Hub Editorial Team · Published

Quick answer: a URL slug is the part of a web address that names one page, such as how-to-write-a-url-slug in /guides/how-to-write-a-url-slug. To write one, take the page title, lowercase it, replace spaces and punctuation with single hyphens, remove accent marks, and trim it to the words that describe the page. The Slug Generator does the mechanical part instantly. Choosing which words to keep is still your job.

A slug is seen in search results, in shared links and in the browser’s address bar. A short, descriptive slug tells a reader what they will get before they click, and it is easier to remember, type and share than a string of IDs. Once a page is published, its slug is also hard to change without breaking links, so getting it right the first time saves work later.

What is a URL slug?

In a URL such as https://www.example.com/blog/best-hiking-boots, the domain is www.example.com, the folder is /blog/, and the slug is best-hiking-boots. Content systems such as WordPress call it the permalink or post slug. Shops use it for product and category pages.

The word comes from newspaper publishing, where a slug was a short working name for a story. On the web the idea is the same: a short label that identifies one page among many.

How to Write a URL Slug: SEO-Friendly Permalinks with Examples — Tools Star Hub

How do I write a good slug?

Use the words a reader would expect. A slug that matches the main topic of the page, such as chicken-biryani-recipe, is clearer than recipe-1043 or my-favourite-thing-to-cook-on-sundays.

Keep it short. Three to six meaningful words is a common range, though there is no fixed rule. Drop filler that adds nothing, such as “the ultimate”, “a complete”, or the current year if the page will be updated later.

Use lowercase letters, digits and hyphens. Most servers treat uppercase and lowercase paths as different addresses, so lowercase avoids duplicates. Hyphens are the usual word separator in URLs. Underscores join words visually but are less common in paths.

Avoid changing it later. If you rename a published slug, set up a permanent redirect from the old address to the new one, or old links and bookmarks will hit a not-found page.

How does the Slug Generator turn a title into a slug?

The tool follows a short, predictable set of rules. It removes accent marks from Latin letters, so é becomes e and ü becomes u. It lowercases the text. It replaces every run of characters that are not letters or digits, including spaces, punctuation, emoji and symbols, with one hyphen. Finally it removes hyphens from the start and end.

Letters from other scripts are kept. A title in Chinese, Arabic or Russian keeps those characters, joined with hyphens. Browsers display them normally, and they are percent-encoded when sent over the network. If your platform needs plain ASCII slugs, you will need to transliterate those words yourself.

Titles and the slugs the generator produces
TitleGenerated slugNote
How to Brew Cold Coffeehow-to-brew-cold-coffeeSpaces become hyphens
Café & Bakery Menu (2026)cafe-bakery-menu-2026Accent removed, symbols dropped
10 Tips -- For Beginners!!10-tips-for-beginnersRepeated separators collapse
Crème brûlée recipecreme-brulee-recipeLatin accents removed
你好 world你好-worldChinese letters are kept

The tool does not shorten the slug, remove stop words, or check whether the slug is already used on your site. Those are judgment calls that depend on your page and your platform.

Should I remove words like a, the and to?

Sometimes. Removing small words shortens a slug, as in how-write-url-slug, but it can also make it read oddly. Keep them when they make the phrase natural, and remove them when the slug is long and the meaning survives without them.

Do not remove words that change the meaning. “Not”, “without” and “vs” matter: gluten-free-bread and bread-without-gluten are fine, but dropping “without” would produce the opposite page title.

Should a slug include dates, numbers or IDs?

Include a number when it is part of what the page is, such as a model number, a year for an event that will not repeat, or a step count that will not change. Leave out dates and counts that will go stale, such as best-laptops-2026 for a page you plan to refresh every year, or 7-tips when you might add an eighth.

Database IDs are useful to systems, not readers. Some platforms add an ID automatically to keep slugs unique. If yours does not, check for duplicates before you publish, because two pages cannot share the same path.

Do URL slugs help with SEO?

Google’s own documentation on URL structure recommends simple, descriptive URLs that use readable words, and suggests hyphens rather than underscores to separate them. A clear slug will not rescue a weak page, but it helps people decide to click when they see the link, and it gives a small, honest hint about the topic.

The bigger risks are self-inflicted. Changing slugs often, publishing two pages with near-identical slugs about the same topic, or stuffing a slug with repeated keywords, such as cheap-shoes-cheap-running-shoes-buy-cheap, makes a site harder to understand and maintain. Write the slug for a person reading it in a search result, and keep it stable.

If a page is translated, give each language version its own readable slug in that language, and connect the versions with the hreflang tags your CMS supports, rather than reusing the English slug everywhere.

How to create a slug with the generator

  1. Type or paste the page title. Enter the title or phrase in the Title or text box. The slug appears below as you type.
  2. Read the generated slug. Check that the words still describe the page. Delete filler words from the title box and the slug updates with them.
  3. Copy the slug. Press Copy slug and paste it into your CMS permalink field, file name or route. Nothing you type is sent to a server.
  4. Check it on your site. Make sure no other page already uses the same slug, and add a redirect if you are replacing an older address.

Example

A blog post title

Title: “The 5 Best Ways to Keep Basil Fresh (Tested!)”. Generated slug: the-5-best-ways-to-keep-basil-fresh-tested. A shorter edit might be keep-basil-fresh or how-to-keep-basil-fresh.

A product page

Title: “Men’s Waterproof Hiking Boot – Brown, Size 42”. Generated slug: men-s-waterproof-hiking-boot-brown-size-42. The apostrophe became a hyphen, so edit the title to “Mens” first if you prefer mens-waterproof-hiking-boot.

A file name for an image

Title: “Hunza Valley at Sunset”. Generated slug: hunza-valley-at-sunset, which works as hunza-valley-at-sunset.jpg.

A category page with an ampersand

Title: “Shoes & Bags”. Generated slug: shoes-bags. The ampersand is dropped rather than spelled out, so type “Shoes and Bags” first if you want shoes-and-bags in the address.

Tips and limitations

Apostrophes become hyphens

Any non-letter, including an apostrophe, is a separator, so don’t becomes don-t. Remove apostrophes from the title first if you want dont.

Your CMS may differ

WordPress, Shopify and other platforms have their own slug rules and may handle accents or length differently. Paste the generated slug into the permalink field so the platform does not regenerate it.

Encode, do not slug, full URLs

A slug is for one path segment. To make a full address with query strings safe, use the URL Encoder instead.

FAQ

Should I use hyphens or underscores in a slug?
Hyphens are the common choice for readable URL paths, and the generator uses them. Underscores are more often seen in file names and code.
How long should a URL slug be?
There is no official limit that matters in practice, but short slugs of a few descriptive words are easier to read, share and remember.
Can I change a slug after publishing?
You can, but old links will break unless you add a permanent redirect from the old path to the new one.
Why are uppercase letters converted to lowercase?
Many servers treat paths as case-sensitive, so /Page and /page can be different addresses. Lowercase avoids accidental duplicates.
What happens to emoji and symbols in a title?
They are treated as separators and removed, so “Pizza 🍕 Night” becomes pizza-night.
Does the slug keep non-English letters?
Letters in scripts such as Chinese, Arabic or Cyrillic are kept. Only accent marks on Latin letters are removed.
Should the slug match the page title exactly?
Not necessarily. The title can be longer and more descriptive, while the slug keeps the core words of the topic.
Is a slug the same as a permalink?
The permalink is the full, permanent URL of a page. The slug is the last readable part of it.
Can two pages have the same slug?
Not in the same folder. Two pages at the same path would collide, so most CMSs add a number to the second one.
Does the generator remove stop words automatically?
No. It keeps every word from your title. Delete words such as the or and from the input if you want a shorter slug.
Should I strip years from news slugs?
Keep a year only when it disambiguates evergreen titles; otherwise shorter topical slugs age better.
How do I slugify titles with ampersands?
Replace & with “and” or drop it so the slug stays readable without encoded characters.
Do trailing slashes belong in the slug field?
No—the slug is the path segment; your host adds or normalizes trailing slashes separately.
Should category folders sit before the slug?
Many CMS paths use /category/slug; keep the slug itself free of duplicated category words.
How do I handle duplicate draft titles?
Add a short disambiguator (product, city, or year) so each published slug stays unique.
Is transliteration better than dropping accents?
Transliterate when readers search Latin keywords; some sites keep Unicode if the stack supports it.
Can query strings be part of a slug?
No—slugs exclude ? and & parameters; keep tracking tags out of the path.
Should I update slugs when retitling lightly?
Avoid churn for tiny title edits; change slugs when the topic truly shifts, then redirect.
How short is too short for a slug?
Single generic words collide often; two or three clear tokens usually balance clarity and length.
Do ebook or PDF vanity URLs follow the same rules?
Yes—human-readable hyphenated segments still help sharing even for download landing pages.

Turn any title into a clean permalink with the free Slug Generator.

To see how each part of an address is named, open the URL Parser.

For the title and description that go with the page, the Meta Tag Generator writes the HTML.

Sources and further reading