How to Create SEO-Friendly URLs and Slugs for Your Pages
seourlsguideA web address is the first thing a page says about itself, before the title or any content. Compare example.com/blog/how-to-repeat-text with example.com/index.php?id=4817&cat=12. The first tells you what you’ll find. The second tells you nothing and looks like trouble.
Good addresses are easy to build. You mostly need to follow a handful of habits and avoid a handful of mistakes.
What a slug is
The slug is the part of an address that identifies one particular page, usually at the end: how-to-repeat-text in the example above. Most content systems generate it from the page title, which is a good starting point and often needs a little tidying.
The habits that work
Keep it short and readable. Three to six meaningful words is a good target. If a title is long, the slug doesn’t have to repeat all of it. “How to repeat text in Excel and Google Sheets” can sensibly be repeat-text-excel-google-sheets.
Use lowercase. Some servers treat capital letters as different addresses, which can produce duplicate pages and broken links. Lowercase avoids the issue.
Separate words with hyphens. Search engines treat hyphens as word separators. Underscores can be read as joining words together, so text_repeater may be seen as a single word. Hyphens are the standard.
Use plain letters and numbers. Accented letters, spaces, punctuation and symbols can turn into percent-encoded sequences such as %20 in links, which look messy and break more easily when pasted. A slug generator that strips accents and symbols handles this for you. Try our slug generator on your next title.
Describe the page. The slug should match what a reader will find. If the page is a text repeater, text-repeater says so.
Match the topic, not a keyword list. Including the main topic word is helpful. Cramming five keyword variants into the address isn’t, and it looks spammy to people.
The mistakes to avoid
Dates in the address. /2026/10/title makes content look dated, and it forces you to change the address if you update the page and want to change its date. Unless your site is a news archive, leave dates out.
Stop words that add nothing. Words like “a”, “the” and “of” often add length without meaning. Remove them when the slug still reads sensibly, but don’t force it: “how-to-remove-duplicate-lines” is fine with its “to”. The slug tool has an option to strip small words.
Parameters and session IDs. Addresses full of ?id= and &sort= are harder to read and harder to share. Use clean paths where you can.
Very deep folders. /a/b/c/d/e/page is hard to read and suggests an overcomplicated site. Keep the structure shallow.
Changing slugs casually. Every time you change an address, existing links to the old one break, unless you handle it. See below.
What to do if you must change a slug
Sometimes you have to: a typo, a restructure, a rebrand. When you do, set up a permanent redirect (a 301 redirect) from the old address to the new one. That sends visitors, and search engines, from the old address to the new one automatically, and passes along most of the page’s existing standing. Without a redirect, anyone with the old link lands on an error page. Update your internal links to the new address too, rather than relying on the redirect.
Slugs for many pages at once
If you’re migrating a site or importing a lot of content, you’ll want slugs in bulk. Paste a column of titles into the slug generator, one per line, and you get a column of slugs in the same order. Check for collisions afterwards: two different titles can produce the same slug once punctuation is removed, so run remove duplicate lines or sort the list with sort lines to find clashes. Add a path prefix to every line with add text to each line to make full paths.
Slugs in other places
The same rules help elsewhere. File names for downloads and images are cleaner as lowercase hyphenated words. Database keys and CSS class names often follow a similar convention, and the case converter can switch between kebab-case, snake_case and camelCase as needed.
Non-English addresses
Modern browsers can display addresses in many writing systems, and search engines understand them. If your audience reads Arabic, Chinese or Hindi, native-language slugs can be perfectly reasonable. The caveat is that when such links are copied into some apps, they may show as long percent-encoded strings. Weigh readability in the places your audience will actually share links.
A quick checklist
- Short, lowercase, hyphens.
- Plain letters and numbers only.
- Describes the page honestly.
- No dates, parameters or needless depth.
- Never changed without a redirect.
Get those right once, in a template or a habit, and you’ll rarely have to think about slugs again.