How to make a URL slug
- Type or paste a title. For several, put one on each line.
- Choose hyphens or underscores, and whether to keep everything lowercase.
- Optionally set a maximum length and remove common words like “the” and “of”.
- Copy the slugs. Each line of the result matches the same line of your titles.
What changes, with examples
| Title | Slug | What happened |
|---|---|---|
| How to Bake Bread | how-to-bake-bread | Lowercased, spaces become hyphens |
| Crème Brûlée & Co. | creme-brulee-and-co | Accents removed, & spelled out, full stop dropped |
| Don't Panic: 10 Tips! | dont-panic-10-tips | Apostrophe removed inside the word, punctuation dropped |
| Straße in München | strasse-in-munchen | ß spelled ss, umlaut removed |
| Привет мир | privet-mir | Cyrillic transliterated to Latin letters |
| The Best Way to Bake a Loaf | best-way-bake-loaf | With “Remove common words” on |
Tips for good slugs
- Use a few words that describe the page; leave out dates if the page will be updated.
- Separate words with hyphens, as Google recommends, rather than underscores or nothing.
- Keep it lowercase: some servers treat
/Breadand/breadas different pages. - Once a page is published, keep its slug. If you must change it, redirect the old URL to the new one.
Sources
Each link was last checked on .
- URL structure best practices for Google Search, Google Search Central: readable words in URLs, hyphens rather than underscores between words, and percent-encoding non-ASCII characters.
Common uses
- Naming a new blog post. Paste the post's title to get a short, lowercase slug for the URL field in WordPress, Ghost or your own CMS, with accents and punctuation handled.
- Bulk URLs for an import. Paste a column of product or article titles, one per line, and copy back a matching column of slugs for a spreadsheet or CSV import.
- File and anchor names. Make safe names for files, folders or heading anchors from human titles, with underscores if the system needs them and a length limit for long names.