Technical SEO

SEO-Friendly URLs: How to Structure Slugs, Folders, and Parameters

By the SEOtest.app Editorial TeamMay 6, 20268 min read

A good URL is short, readable by a human, and stable over time. That's most of it. Much of the URL advice online is fussier than the payoff justifies, so this post separates what actually affects SEO from what's just housekeeping, and it's honest about which is which.

The single biggest URL mistake isn't a bad slug. It's changing URLs that were fine, because every change costs you redirects, lost link equity, and risk. We'll get to that, but the rule underneath everything here is: get the URL reasonable at creation, then leave it alone.

Slug rules that matter

The slug is the last part of the URL, the bit that names the page. A few rules genuinely help:

  • Keep it short. Three to five words is plenty. /blog/seo-friendly-urls beats /blog/how-to-create-the-most-seo-friendly-url-structure-for-your-website. Long slugs get truncated in results and read as spammy.
  • Use hyphens, not underscores. Google treats a hyphen as a word separator and an underscore as a word joiner, so seo_friendly can be read as one token. Hyphens have been the recommendation in Google's own documentation for years.
  • Lowercase only. On many servers /About and /about are different URLs, which splits signals and invites duplicate-content issues. Force lowercase.
  • Include the target keyword, once. /running-shoes is good. /best-running-shoes-buy-running-shoes-online is keyword stuffing and reads as such.

The dates and stop-words debate, honestly

Two slug questions get argued to death. Here's the practitioner take.

Dates in URLs (/2026/05/my-post) aren't a ranking problem, but they date your content visibly and make evergreen updates awkward, because a 2022 URL on a freshly updated post looks stale. If you can, leave dates out of the slug. If your CMS already puts them there and the pages rank, don't rip them out just for this; the redirect cost isn't worth it.

Stop words (a, the, for, of) are the smaller question. Removing them makes a cleaner slug (/guide-seo-urls over /a-guide-to-seo-urls), and Google handles either fine. Cut them for tidiness, but this is not something to lose sleep over or, again, to change existing URLs for.

Folder structure and the depth myth

There's a persistent belief that pages "buried" three or four folders deep rank worse purely because of the slashes. That's mostly a myth. Google has said click depth (how many clicks from the homepage) matters more than URL depth (how many slashes). A page at /a/b/c/d/product that's one click from your homepage is fine; a page at /product that's orphaned five clicks deep is not.

That said, folders do useful work when they mirror real structure:

/blog/technical-seo/seo-friendly-urls
/shop/mens/shoes/running

This tells users and crawlers where a page sits, and it enables clean breadcrumb navigation. Use folders to reflect genuine hierarchy, not to game anything. Don't nest for the sake of it, and don't flatten a logical structure just to reduce slashes. Depth in itself is not the lever; internal linking is. The internal linking strategy post covers how to keep important pages shallow in clicks regardless of URL depth.

Trailing slashes: pick one and enforce it

example.com/page and example.com/page/ are technically different URLs, and if both resolve with a 200, you've got two copies of one page competing. This is a real duplicate-content trap, and it's entirely avoidable.

Pick one convention (with or without the trailing slash, either is fine) and redirect the other with a 301. Most static-site hosts and frameworks have a setting for this; use it. Then make sure your internal links all use the chosen form so you're not generating redirects on your own site. To confirm the redirect actually fires and doesn't chain, run a page through our redirect checker.

Parameters and canonicals

URL parameters (?color=blue&sort=price) are where duplication quietly multiplies. Filtering, sorting, tracking, and session parameters can generate dozens of URLs that all serve near-identical content, and Google can waste crawl budget on them.

The tool for this is the canonical tag. Point every parameter variation at the clean base URL:

<link rel="canonical" href="https://example.com/shoes">

So /shoes?sort=price&color=blue carries a canonical to /shoes, consolidating the signals. A few specifics:

  • Tracking parameters (?utm_source=...) should always canonical to the clean URL. They're for analytics, not for indexing.
  • Filter and sort parameters usually should canonical to the base category, unless a specific filtered view is genuinely a page you want to rank (a popular /shoes?color=black might deserve its own indexable page instead).
  • Pagination (?page=2) should self-canonical, not point page 2 back to page 1. Each page has distinct content.

For the full mechanics of when and how to use canonicals, see the canonical tags and duplicate content guide.

When NOT to change a URL

This is the part most URL guides skip, and it's the most important. Changing a URL is not free. Even with a perfect 301 redirect, you risk a temporary ranking dip, you add a redirect hop that slows the page slightly, and every old inbound link now points at a redirect rather than the destination. Do it enough and you build up redirect chains, which are their own problem (the redirect chains and loops post covers untangling those).

So don't change a URL for cosmetic reasons. An older URL with an underscore, a stop word, or a date is not worth a migration if the page ranks. The rule of thumb: only change a URL when the current one is actively causing a problem (it's broken, it exposes a parameter mess, or it's genuinely misleading), and when you do, map old to new with a single-hop 301 and update your internal links to point at the new URL directly. If you must migrate, 301 vs 302 redirects explains why permanent moves need a 301, not a 302.

Get the URL reasonable when you create the page. After that, stability beats optimization almost every time.

Frequently Asked Questions

Should I use hyphens or underscores in URLs?

Hyphens. Google treats a hyphen as a word separator, so seo-friendly-urls is read as three words, while an underscore joins them into one token. This has been Google's documented recommendation for years. Use hyphens between words in every slug.

Do URLs need keywords for SEO?

Including your target keyword once in the slug is a small, sensible signal and makes the URL readable, which helps click-through. But don't stuff keywords or repeat them; /best-shoes-buy-shoes-online looks spammy and helps nothing. One clear keyword phrase in a short slug is the goal.

Does folder depth hurt SEO?

Not by itself. Google weighs click depth (clicks from the homepage) more than URL depth (number of slashes). A deeply nested URL that's well linked and one or two clicks from your homepage is fine. Use folders to reflect real structure, and keep important pages shallow through internal linking rather than by flattening URLs.

Trailing slash or no trailing slash: does it matter?

The choice between them doesn't matter for SEO, but consistency does. If both /page and /page/ return a 200, you have duplicate URLs competing. Pick one form, 301-redirect the other to it, and make your internal links use the chosen version.

When should I not change a URL?

When the current URL works and the page ranks. Changing it, even with a proper 301, risks a ranking dip, adds a redirect hop, and points existing links at a redirect. Cosmetic fixes like removing an underscore or a stop word aren't worth a migration. Only change a URL when it's broken, misleading, or causing a real problem.

Related Guides

Put this knowledge into action

Analyze your website with our free SEO tool and get instant recommendations.

Analyze Your Website