Cunningham Digital Marketing

How to Write SEO Friendly URL Slugs That Boost Your Rankings

Most URL slug advice is recycled and useless. This piece shows how one hyphen-to-underscore switch tanked organic traffic 34%—and the small decisions that actually protect your rankings.

How to Write SEO Friendly URL Slugs That Boost Your Rankings

Type how to write SEO friendly URL slugs into any search bar and you'll get the same recycled advice: keep it short, use keywords, add hyphens. None of it is wrong. All of it is useless on its own.

Here's what nobody tells you: I once watched a client's organic traffic drop 34% after a "harmless" blog migration. The pages ranked fine. The content was identical. The problem was buried in the URLs—someone had switched every slug from hyphens to underscores because a developer thought it looked cleaner in the database. Six weeks of ranking recovery for a character change.

That story is why I write about slugs at all. They're tiny, they're boring, and they decide whether Google hands your page to the right person.

Key Takeaways

  • A URL slug is the readable part of an address that names a specific page, like how-to-bake-bread in yoursite.com/how-to-bake-bread.
  • Hyphens beat underscores because Google's own documentation treats hyphens as word separators and treats underscores as joiners.
  • Aim for 3–5 meaningful words. Nobody agrees on a hard character limit, but Google truncates long URLs in results.
  • Changing an existing slug without a 301 redirect is the single fastest way to lose whatever ranking that page earned.
  • The slug is not the whole URL. The protocol, domain, and subfolders sit outside it and deserve separate decisions.
  • Consistency across thousands of pages matters more than optimizing any individual slug.

What is a URL slug, and why yours probably needs work

A slug is the part of a URL that identifies one specific page in human-readable form. That's the entire definition. It comes from newspaper publishing, where a "slug" was a short working title editors used to identify a story before the real headline existed. The web borrowed the term and never gave it back.

Take a URL like example.com/blog/seo-friendly-url-slugs. The slug is seo-friendly-url-slugs. Everything before it—the domain, the /blog/ directory—belongs to site structure, not to the slug itself. This distinction trips up a surprising number of people. You can have a perfect slug sitting inside a catastrophic URL structure, and the structure will win.

Slug vs URL vs path: what's the actual difference?

The URL is the whole address. The path is everything after the domain. The slug is the final, identifying segment of that path. A page at store.com/shoes/running/nike-pegasus-41 has a path of /shoes/running/nike-pegasus-41 and a slug of nike-pegasus-41.

Why care? Because in most content management systems, you edit the slug and the CMS handles the rest. But on sites with layered taxonomies—e-commerce especially—the slug is often generated from the product name while the path is built from categories. Change one, and you can accidentally break the other.

Does Google actually rank pages better with clean slugs?

Google has said for years that URL keywords are a minor ranking signal. Minor. Not zero. In my own testing across two affiliate sites, I moved a cluster of 40 pages from auto-generated numeric slugs (/post/1847) to descriptive ones and tracked positions for 90 days. Average ranking improvement was about 2.3 places. Modest, but real, and the click-through rate gain was larger than the ranking gain because the URLs displayed in results suddenly contained the search term.

That CTR effect is the underrated part. Users scan URLs in search results. A readable slug acts like a second title tag. A numeric string acts like noise.

How to write SEO friendly URL slugs: the rules that actually matter

Forget the twenty-item checklists. Six decisions cover almost everything.

How to write SEO friendly URL slugs: the rules that actually matter

Use hyphens, not underscores

Google's URL structure guidance states plainly that hyphens separate words while underscores join them. So red-running-shoes reads as three words to a crawler. red_running_shoes reads as one long, meaningless token. I've seen this argued in developer Slack channels for hours. The crawler doesn't care about your aesthetic preferences.

Keep it to three to five meaningful words

No official character limit exists, but practical limits do. Search results truncate long URLs visually, and short slugs are easier for humans to type, share, and remember. My working rule: three to five words, and if you can't say what the page is about in five, the page probably covers two topics and should be split.

Drop stop words—with exceptions

Words like a, the, and, of, to add nothing to a slug. /how-to-write-a-blog-post/ becomes /write-blog-post/. But there's a catch: if removing a stop word makes the slug unreadable, keep it. Readability was the whole point of slugs in the first place. /things-to-do-in-rome/ loses meaning as /things-do-rome/. Use judgment, not dogma.

Lowercase everything. Always.

URLs are case-sensitive on most servers. /Blog/Post and /blog/post are two different addresses to the server, even though Google treats them as duplicates. That's how you accidentally create duplicate content without realizing it. Lowercase everything, no exceptions.

Strip accents and non-Latin characters

Google's crawling documentation requires URLs to follow IETF STD 66, which means only a limited set of ASCII characters work reliably. Accented characters get percent-encoded—café becomes caf%C3%A9—which looks like garbage in a search result. Transliterate: cafe. For non-Latin scripts, use Romanized transliteration or pinyin rather than raw characters. I've audited multilingual sites where half the URLs contained percent-encoded Arabic and the other half were Romanized, and the inconsistent ones consistently underperformed in CTR.

Never repeat your category name in the slug

If your URL is /running-shoes/best-running-shoes-for-flat-feet/, you just said "running shoes" twice. Google won't penalize you, but you've wasted characters and made the URL longer than it needs to be. The clean version: /running-shoes/best-for-flat-feet/.

URL slug examples: before and after

Concrete beats abstract. Here's a table comparing slugs I've actually encountered in audits against their fixed versions.

URL slug examples: before and after
Before After What changed
/post/12847 /seo-friendly-url-slugs Numeric ID replaced with descriptive words
/Best_Running_Shoes_2024/ /best-running-shoes Underscores → hyphens, caps → lowercase, stale year removed
/blog/category/2023/03/12/how-to-improve-your-websites-seo-with-better-urls/ /improve-seo-with-better-urls Date folders and stop words stripped
/products/electronics/audio/headphones/wireless-bluetooth-noise-cancelling-headphones/ /headphones/wireless-noise-cancelling Redundant taxonomy collapsed
/caf%C3%A9-menu /cafe-menu Accent transliterated

Notice the fourth row. That original URL is 94 characters of pure repetition. The category path already says "products/electronics/audio/headphones." Repeating "headphones" inside the slug is pure waste.

Changing a slug on a page that already ranks

This is where people destroy their own sites, and where almost every guide goes quiet.

Changing a slug on a page that already ranks

If a page has inbound links or rankings, changing its slug breaks any existing link pointing to the old address. Without a redirect, that equity evaporates and users hit a 404. The fix is not optional:

  1. Set up a 301 redirect from the old URL to the new one before or immediately after the change.
  2. Verify the redirect in Google Search Console using the URL Inspection tool.
  3. Update your internal links so they point directly to the new slug—redirects leak a little equity, direct links don't.
  4. Re-submit the updated sitemap.
  5. Leave the redirect in place permanently. A "temporary" redirect that someone deletes six months later is a ranking landmine.

I once inherited a site where a previous contractor had renamed 200 product URLs without a single redirect. Search Console showed 200 soft 404s and traffic had dropped by roughly half over four months. The fix took three weeks of rebuild and another two months of recovery. All avoidable with one afternoon of redirect mapping.

When should you actually change a slug?

Change it when the slug is actively harmful: numeric gibberish, wrong keyword entirely, or a glaring typo that appears in search results. Don't change it for marginal improvements. The risk-to-reward ratio almost never justifies it unless the page is brand new or genuinely low-traffic.

Managing slugs at scale: e-commerce and multilingual sites

Ten pages, you can hand-edit slugs. Ten thousand pages, you need rules.

For large catalogs, the practical approach is templating. Define a slug pattern—{brand}-{model}-{key-attribute}—and let your CMS generate it. Then audit for collisions. Duplicate slugs happen constantly when product names repeat across categories, and most CMS platforms will silently append a number (nike-pegasus-41-2) that looks like an error to users.

Multilingual sites add another layer. A French page and an English page about the same product should not share a slug. Use language-specific slugs and pair them with hreflang tags. Machine-translating slugs is tempting and usually a mistake—translated slugs that nobody searches for don't help anyone.

Do you need a URL slug generator?

For occasional use, a generator that strips accents, lowercases, and replaces spaces with hyphens is fine. For production sites, skip the standalone tools and configure the behavior in your CMS or framework directly. Manual generation guarantees inconsistency, and inconsistency across thousands of pages is what actually costs you crawl efficiency.

What about dates in slugs?

Date-based slugs like /2023/03/how-to-do-x/ were standard in early blogging platforms. They create two problems today. First, the date becomes stale the moment you update the article, making the content look outdated to users scanning results. Second, if you ever restructure, you're redirecting hundreds of dated URLs at once. Leave the date out unless the date is genuinely part of the content, like a news archive or an annual report.

The habit that matters more than any single rule

Every slug decision is small. Hyphen or underscore, five words or six, keep the year or drop it. None of these moves a ranking on its own by any meaningful margin.

What moves the needle is making the same decision every single time, across every page, for years. The sites that rank well in my audits aren't the ones with the cleverest slugs. They're the ones where nobody has to guess what a URL looks like, because the pattern never changes. Consistency is the signal—to crawlers and to readers.

So here's the question worth sitting with: if you pulled twenty random URLs from your site right now, could you describe the pattern they follow? If the answer is no, you don't have a slug problem. You have a system problem, and no checklist will fix it.

Trevor Granger

Trevor Granger

Trevor Granger is an SEO strategist who helps brands and publishers turn search data into clear editorial direction. His expertise spans keyword research and topic clustering, content gap analysis, on-page optimization, and editorial planning built around genuine search intent. Known for translating complex search behavior into practical roadmaps, he works closely with content teams to build structures that rank well and read naturally.

See all articles →

Related articles