A slug is the readable part of a URL — the word-count-cjk-vs-english in a link to this guide. The rules that produce a good one are short: lowercase, words separated by hyphens, no punctuation, three to six meaningful words, no dates or database IDs, and one permanent choice per page. Get those right and the slug does its two jobs: it tells a reader what is behind the link before they click, and it gives a search engine a clean set of words to attach to the page.
The rules matter less than the consistency. A site whose URLs are all lowercase, hyphenated and descriptive reads as maintained; one with /page?id=4821 next to /Best-Guide_2024/ next to /post/ reads as assembled by three different people.
What a search engine does with a slug
Search engines tokenise a URL into words, much as they tokenise body text, and those tokens are one input into understanding what the page is about. The slug is a weak signal compared with the page title, the headings, the body text and the anchor text of links pointing at the page — a keyword-stuffed slug will not rescue a thin page, and a plain one will not sink a good page.
Where the slug does have outsized influence is in what people see. URLs appear in search results, in social previews, in chat apps that unfurl links, and in the status bar when a reader hovers. A descriptive slug raises the confidence of a click; a random one lowers it. Analytics and sharing add a second constraint: a URL that people can retype, dictate and shorten survives being copied by hand, and one with percent-escapes does not.
There is also the duplicate-content angle. If the same page is reachable at /Guide, /guide and /guide/, you have three URLs for one document, and links and crawl budget get split across them. One canonical spelling, lowercase, without a trailing slash variant, avoids the problem at the source.
The eight generation rules
- Lowercase everything. Paths are case-sensitive on most servers, so
/Guideand/guideare two pages that may both resolve. Lowercase removes the ambiguity and the duplicate. - Separate words with hyphens, not underscores or spaces. A space in a URL becomes
%20, which is unreadable, and underscores are commonly read as joining words rather than separating them. - Strip accents, or transcribe them.
cafébecomescafe; the meaning survives and the URL stays typeable. Full Unicode is legal in a URL, but it is percent-encoded in transit and in most copied forms. - Drop punctuation entirely. Apostrophes, commas, quotes, parentheses and ampersands have no place in a slug.
don'tbecomesdont, andFish & Chipsbecomesfish-and-chipsorfish-chips— pick one policy and keep it. - Collapse runs of separators. A title with a slash or a double space produces
--if you replace characters one at a time. Collapse every run to a single hyphen and trim the ends. - Front-load the distinguishing words.
how-to-count-wordsbeatsa-guide-to-the-method-of-counting-words. The first two or three words are what people see when a URL is truncated in a result or a share card. - Leave out dates, IDs and version numbers unless the date is the point.
/2026/11/19/word-countguarantees the slug is wrong next year;black-friday-2026is fine because the year is the subject. - Keep it short. Three to six words, under about 60 characters, is the zone where a URL is readable at a glance. Beyond that, truncation takes over and the tail of the slug stops earning its place.
Hyphens versus underscores
Google's own URL guidance recommends hyphens as the word separator, and it is widely documented that underscores are not treated as separators — a URL like word_count_guide is read closer to one long token than to three words. That single difference is why kebab-case, not snake_case, is the case style for URLs.
The exception is a legacy site with years of underscore URLs. Rewriting them all for a marginal gain is usually a bad trade: the redirect work, the lost link equity and the risk of broken deep links outweigh the benefit. Follow the convention of the site you have; use hyphens in anything new.
How long, and which words to drop
Short slugs are better for readability, not because search engines penalise length. Two to five words captures most topics. The interesting question is stop words — a, the, of, for, to, in — which add nothing semantically and are largely ignored by search engines. Dropping them produces tighter slugs (guide-word-count vs a-guide-to-word-count), but it can also produce awkward phrases that read like keyword soup.
A practical middle ground: keep prepositions when they make the slug readable and drop articles that add nothing. how-to-format-json keeps to because it makes the phrase natural; the-complete-guide-to-the-json-format is 40 characters of mostly filler and can become json-format-guide.
Non-Latin titles: transliterate or encode?
Chinese, Japanese, Arabic and Cyrillic titles force a choice. A URL may contain those characters directly — browsers display them normally and percent-encode them on the wire — or the slug may be transliterated into ASCII.
| Approach | Example | Trade-off |
|---|---|---|
| Native characters | /字数统计指南 | Readable to local readers, opaque when copied into systems that escape it |
| Pinyin / romanisation | /zi-shu-tong-ji-zhi-nan | Typeable and stable, but long and meaningless to anyone who does not read pinyin |
| English translation | /word-count-guide | Short and shareable, but mismatched with a native-language page title |
| Hybrid | /word-count-guide-zh | Signals the language version in a typeable form |
All four work. What does not work is mixing them arbitrarily across one site: a Chinese-language site whose URLs alternate between pinyin and English translations looks unplanned, and analytics get harder to read. Choose per site, document the choice, and keep the language directory (/zh/, /ja/) separate from the slug itself.
If you do keep native characters, be aware of the practical costs: copied links become long percent-encoded strings in chat apps and email, some analytics tools truncate them, and verbal sharing is impossible. For a site that lives on word of mouth or QR codes, ASCII slugs win.
Changing a slug later
Sometimes a slug has to change: a typo shipped, a topic was renamed, a product line was discontinued. The cost is entirely in what you do next.
- Add a 301 redirect from the old URL to the new one and keep it permanently. A redirect passes readers and, in most cases, ranking signals; a 404 passes nothing.
- Update internal links. Redirects are a safety net, not a routing strategy. Links inside your own site should point at the final URL so the redirect is never exercised.
- Do not reuse the old slug for new content. Readers and search engines have the old URL associated with the old topic; repurposing it creates a confusing swap. Leave it redirected to the new address, or let it 404 honestly.
- Update the sitemap and canonical tags at the same time. A sitemap that still lists the old URL slows down the re-crawl.
- Change once. Two redirect hops in sequence (A→B→C) is a chain that some crawlers follow less reliably than a single hop. Point A directly at C.
Good and bad slugs, compared
| Title | Slug | Verdict |
|---|---|---|
| How to Count Words in Chinese and English | how-to-count-words | Good: short, front-loaded, typeable |
| How to Count Words in Chinese and English | How_To_Count_Words_In_Chinese_And_English | Bad: capitals, underscores, filler words |
| JSON Errors (2024 Update) | json-syntax-errors | Good: no year that will age |
| JSON Errors (2024 Update) | /p/1842?ref=home | Bad: no words, only an ID |
| Café Menu | cafe-menu | Good: accent removed, meaning kept |
| Café Menu | caf%C3%A9-menu | Works, but unreadable when copied or spoken |
FAQ
Do keywords in a slug still help ranking?
They help a little. The slug is one of many on-page signals, and search engines are good at identifying the topic from the title and body without help from the URL. The stronger reasons to write descriptive slugs are human: click-through, shareability, and the ability to tell what a link is before opening it. A slug optimised only for a keyword phrase, at the cost of readability, is a net loss.
Can a slug contain Chinese characters?
Yes. URLs may contain any Unicode character, encoded as UTF-8 and percent-escaped on the wire. Browsers display the decoded form, so local readers see /字数统计 normally. The drawbacks are practical rather than technical: copied links become long escape sequences, spoken or printed URLs are unusable, and some tools and analytics systems truncate them. Many publishers use pinyin or an English translation for that reason.
Should the slug match the page title exactly?
No. The title is written for a reader in a result list, with capitalisation and often a subtitle; the slug is a compressed identifier. Word Count: Why Chinese Counts Characters and English Counts Words compresses cleanly to word-count-cjk-vs-english — same meaning, a third of the length. Keeping the two different is normal and expected.
Generate one from any headline with the TextBench slug generator, and read the case-style guide for why kebab-case is the only sensible choice for URLs.
Written by the TextBench team. Last updated November 19, 2026.