BF50 Black Friday · 50% off all plans
from $5/mo · Auto-applied ---:--:-- Claim 50% off →
Skip to content

Search Seonio

Type a keyword, domain, or paste a URL

Start free with $1 to see full results. Powered by Seonio
SEO

Slug: How to write clean URL slugs

What a URL slug is, how to write one people can read (short words, hyphens, lowercase), and how to change a slug without losing traffic.

Monthly searches · slug
301.0k
Keyword research data
slug
Slug: How to write clean URL slugs
Click the image to view it full size

A slug is the readable part at the end of a URL path that names one specific page. In https://example.com/blog/how-to-brew-cold-brew, the slug is how-to-brew-cold-brew. Content management systems usually build it from the page title, and you can edit it before you publish.

Readers see the slug in the browser's address bar, in shared links and sometimes in search results, so it's worth a few seconds of thought.

Where the slug sits in a URL

A URL has several parts. The slug is the last segment of the URL path:

Part Example
Scheme https
Host example.com
Path /blog/how-to-brew-cold-brew
Folder (directory) /blog/
Slug how-to-brew-cold-brew
Query string ?ref=newsletter

The folders before the slug describe where the page sits in your URL structure. The slug describes the page itself. In a blog, the slug is the part of the permalink you control most directly.

How Google uses the words in a slug

Google recommends readable words rather than long ID numbers in URLs (Google Search Central). Its SEO Starter Guide adds that parts of the URL can appear in search results as breadcrumbs, and that Google learns those breadcrumbs from the words in the URL.

Keep expectations realistic, though. The same guide says keywords in the domain name or URL path alone have hardly any effect beyond appearing in breadcrumbs (Google Search Central). A good slug helps people decide to click and helps them remember or share the link. It won't lift rankings on its own.

How to write a good slug

  1. Use words, not codes. /red-running-shoes beats /p/48213.
  2. Separate words with hyphens. Google recommends hyphens (-) and, for historical reasons, advises against underscores (_). Words run together (redrunningshoes) are hard to read.
  3. Use lowercase. Google treats URLs as case sensitive, so /Shoes and /shoes are different URLs. Pick lowercase and stick to it to avoid duplicates.
  4. Keep it short and specific. Name the topic of the page, usually in two to five words. Drop filler words such as "a", "the" or "and" when the slug still reads clearly, and keep them when they carry meaning: /how-to-tie-a-tie is clearer than /tie-tie.
  5. Write in your readers' language. Google suggests using words in your audience's language, including non-English words. In links, non-ASCII characters must be percent-encoded (for example, ü becomes %C3%BC).
  6. Leave out dates and numbers that will age. /best-hiking-boots can be updated every year. /best-hiking-boots-2024 needs a new URL or looks stale.
  7. Make each slug unique. Two pages in the same folder can't share a slug, and near-identical slugs for similar topics hint at keyword cannibalization.
Weak slug Better slug Why
/post?id=8812 /cold-brew-coffee-ratio Words describe the page
/Cold_Brew_Coffee /cold-brew-coffee Lowercase and hyphens
/how-to-make-the-best-cold-brew-coffee-at-home-easy-recipe /cold-brew-recipe Short and focused
/cold-brew-guide-2023 /cold-brew-guide Doesn't age

The slug doesn't have to match the page title word for word. Titles are long and change over time; a short slug that names the subject stays accurate when you rewrite the headline.

Changing a slug without losing traffic

Changing a slug creates a new URL. Links, bookmarks and search results still point to the old one. If the old URL returns a 404, you lose those visitors and the value that other sites' links passed to the page.

If the change is worth it, do it in this order:

  1. Set up a server-side permanent redirect (301 or 308) from the old URL to the new one. Google treats a permanent redirect as a signal that the new URL should be the canonical one (Google Search Central).
  2. Update your internal links to point straight at the new URL.
  3. Replace the old URL with the new one in your XML sitemap.
  4. Keep the redirect in place. For site moves, Google advises keeping redirects for as long as possible, generally at least one year, so it can transfer signals to the new URLs. From a visitor's point of view, it suggests keeping them indefinitely (Google Search Central).

Avoid changing slugs just to add a keyword. The gain is small, and every change costs a redirect hop and some time while Google processes the new URL.

Seonio

Put it to work on your own site

Keyword research, traffic, backlinks and clustering in one place. Start with a free $1 to test, no card required.