URL structure for SEO: slugs, folders and hyphens
A good URL uses readable lowercase words separated by hyphens. What Google documents on slugs, folders and encoding, and when changing live URLs is worth it.
By Crawlito · 9 min read
In short
- Google recommends readable words in URLs and hyphens, not underscores, to separate them; it also advises against long ID numbers.
- Google treats URL paths as case-sensitive, so /Apple and /apple are two URLs; pick lowercase and redirect or canonicalize the rest.
- Google's SEO Starter Guide says keywords in the URL path alone have hardly any effect beyond appearing in breadcrumbs, so URL design is mostly about clarity and crawling.
- Folders help most on large sites: Google says grouping similar pages in directories can help it learn how often each group changes once you pass a few thousand URLs.
- Changing a working URL is rarely worth the risk; if you must, map every old URL to its new one with permanent redirects and keep them, as Google suggests, generally for at least a year.
On this page
- What does Google say a good URL looks like?
- Slugs: readable words, hyphens and lowercase
- Folders and hierarchy: when paths help and when they do not
- Characters, encoding and non-Latin URLs
- Should you change your existing URLs?
- How to audit your URL patterns at scale
- Frequently asked questions
- Check your own pages
A good URL is short, readable and consistent: lowercase words separated by hyphens, grouped in folders that match how your content is organized, with nothing in it that changes between visits. Google's documentation supports most of this: readable words, hyphens, one consistent case and few parameters. It frames the reasons in terms of crawling and clarity, not rankings. If your existing URLs already work, rewriting them is rarely worth it. If they cause real problems, there is a safe way to change them.
This guide covers the choices you make once per site: slug words, hyphens, case, folders and encoding. It then covers how to decide whether to change live URLs and how to audit your patterns. Parameters and trailing slashes get their own treatment in URL parameters and AI search and canonical tags and duplicate URLs.
What does Google say a good URL looks like?
Google's URL structure best practices page asks for four things:
- Readable words. Use descriptive words instead of long ID numbers. Google's own example contrasts
/wiki/Aviationwith a query string of opaque identifiers. - Words in your audience's language. The page gives German and Japanese examples, so a slug does not have to be English.
- Hyphens between words. Google recommends hyphens and discourages underscores and joined words.
- Few moving parts. Trim parameters that do not change content, and shorten URLs where you can.
Notice what the page does not claim. It does not say URL structure is a ranking factor. Its stated concern is that URLs which are hard to parse can make Google crawl a site inefficiently. The SEO Starter Guide is blunter: it says keywords in the domain name or URL path alone have hardly any effect beyond appearing in breadcrumbs. Treat a clean URL as a usability and crawling decision. You make it for people reading a link and for crawlers sorting out your site, not to gain a position.
This post relies on Google's documentation only. Any claim that other AI search tools treat slugs the same way would be an inference, not a documented rule.
Slugs: readable words, hyphens and lowercase
The slug is the last path segment, such as url-structure-seo-best-practices in /blog/url-structure-seo-best-practices.
Use words, not IDs
/guides/robots-txt-for-ai-crawlers tells a person and a crawler what the page is about before it loads. /p?id=48213 tells neither. If your CMS defaults to numeric IDs, look for a "permalink" or "slug" setting before you publish at scale.
Keep the slug close to the page's subject. Google's documentation does not mention stop words such as "a", "the" or "and", so there is no documented rule about removing them. A shorter slug is easier to read and share, but drop a word only if the slug stays clear without it.
Hyphens, not underscores or run-together words
Google says hyphens help users and search engines identify the concepts in a URL. Its reasoning: underscores are common in programming for joining concepts, as in format_date, while a hyphen clearly signals a word boundary. A slug such as urlstructure is also harder to read than url-structure.
RFC 3986 lists hyphens, periods, underscores and tildes as unreserved characters, so an underscore is a valid URL character. The reason to avoid it is Google's stated preference, not validity.
Good: /guides/url-structure
Weak: /guides/url_structure
Weak: /guides/urlstructurePick lowercase and stick to it
Google says URL paths are case-sensitive, so /APPLE and /apple are different URLs. RFC 3986 agrees in principle: apart from the scheme and host, URI components are assumed to be case-sensitive unless the scheme says otherwise. Some web servers serve the same page for both, which is the problem. If both return 200, you have two URLs for one page.
Google's advice is to convert URL text to one case so it can tell they refer to the same page. In practice, publish lowercase slugs, link only to lowercase, and make other cases redirect to the lowercase version. Google's duplicate URL guide describes the tools: a redirect is a strong signal that the target should become canonical, rel="canonical" is also a strong signal, and a sitemap entry is a weak one. It also advises linking internally to the canonical URL.
Folders and hierarchy: when paths help and when they do not
A path like /guides/robots-txt/ groups pages and gives people a sense of where they are. Google's documentation says little about the right depth: neither the URL page nor the Starter Guide gives a maximum number of folders or recommends a particular count.
What it does say is specific to size. Google says that if you have more than a few thousand URLs, organization can affect crawling, and that grouping similar topics in directories can help it learn how often the URLs in each directory change. It gives an example of a rarely changing policies folder crawled less often than a frequently updated promotions folder. The Starter Guide also notes that Google can pick up breadcrumbs from the words in the URL.
That gives you a practical rule:
- Small site (hundreds of pages): folders are optional. Use them if they help people, and do not rebuild a working structure to add them.
- Large site: put content with a similar update pattern in the same folder, so a section such as
/news/can differ from/policies/. - Everywhere: make the folder match a real section of the site. Do not duplicate a page under several folders to cover several topics. That creates duplicate URLs you then have to canonicalize.
Your visible breadcrumbs do not have to copy the URL path either. See breadcrumb navigation and content hierarchy.
Characters, encoding and non-Latin URLs
Stick to unreserved ASCII characters where you can: letters, digits, hyphens, periods, underscores and tildes. RFC 3986 reserves characters such as /, ?, #, & and = for their jobs in a URL, and Google's page says characters the standard defines as reserved must be percent-encoded. A literal space is neither reserved nor unreserved, so it is written as %20. That is one more reason to use hyphens in slugs.
Three more rules from Google's page:
- Do not use fragments to change content. Google says it generally does not support URL fragments (the part after
#), so a single-page app that swaps content under/#/potatoesis not something Google generally supports. For JavaScript-driven changes, Google points to the History API. - Use
=and&for parameters. Google's page shows this standard form, with a comma as an acceptable separator between multiple values for one key. - Encode non-ASCII characters in links. Google recommends percent-encoding in
hrefattributes, and its examples include umlauts, Arabic, Chinese and emoji. For example,übecomes%C3%BC, the UTF-8 bytes for that letter.
Google also encourages using your audience's own language in slugs. A German page can use /lebensmittel/pfefferminz, and a Japanese page can use Japanese words. Whether to use non-Latin characters or a transliteration is a product choice. Google's page mentions both native words and transliterated words and does not rank one above the other.
Should you change your existing URLs?
Usually not. A URL that works, returns 200 and has earned links is an asset, and a slug that is merely imperfect (a stray underscore, a long folder name) does not cause problems on its own. Google's documentation frames URL structure as a clarity and crawling matter, and its Starter Guide says you do not need to reorganize a site right away.
Change URLs when there is a concrete problem:
- Mixed-case or duplicate URLs return
200and split signals between versions. - Session IDs, tracking values or unneeded parameters sit in the path of the links you publish.
- A platform migration or redesign changes URLs anyway. See website migrations.
- The structure confuses visitors and nobody can predict where a page lives.
Redirect and risk checklist
Google's site move guidance gives the outline. Follow it page by page:
- Map every old URL to a new one. Google says to map your old site's URLs to the URLs for the new site. A page with no equivalent needs a deliberate decision, not a redirect to the home page.
- Use permanent server-side redirects. Google recommends server-side permanent redirects where technically possible, such as 301 and 308, and says 301 and other permanent redirects do not cause a loss in PageRank. See status codes and redirects for chains and soft 404s.
- Redirect once, directly. Google advises redirecting each old URL straight to its final destination. Googlebot can follow up to 10 hops, but if a chain is unavoidable Google says to keep it short.
- Update everything that points at the old URL. Google's site move page says to update internal links and to submit a sitemap that lists the new URLs. Canonical tags and navigation should point at the new URLs too.
- Keep redirects in place. Google suggests generally at least one year.
- Expect fluctuation. Google says rankings can fluctuate while it recrawls and reindexes the site, and that for medium-sized sites it can take a few weeks or more for new URLs to replace the old ones in results.
- Watch the results. Check Google Search Console for crawl errors and see how many of your submitted URLs are indexed.
Nobody can promise that a URL change leaves traffic untouched. The checklist reduces avoidable loss; it does not remove the transition period.
How to audit your URL patterns at scale
You do not need to read every URL. Pull them from your sitemap and test for patterns. These commands assume a plain sitemap, not a sitemap index.
curl -s https://example.com/sitemap.xml | grep -o '<loc>[^<]*</loc>' | sed 's/<[^>]*>//g' > urls.txt
wc -l urls.txt
# Uppercase letters in the path
sed -E 's#^https?://[^/]*##' urls.txt | grep -E '[A-Z]'
# Underscores, spaces or encoded spaces
grep -E '_|%20| ' urls.txt
# Query strings in sitemap URLs
grep '?' urls.txt
# Path segments per URL (folders plus the slug)
awk -F/ '{n=NF-3; if ($NF=="") n--; print n}' urls.txt | sort -n | uniq -cThen test how your server answers a different case of a real page:
curl -sI https://example.com/Pricing | grep -iE '^(HTTP|location|link)'
curl -sI https://example.com/pricing | grep -iE '^(HTTP|location|link)'If the first request returns 200 with no redirect, and the page's canonical (in a Link header or the HTML) does not point at the lowercase URL, the server is serving both as separate pages. If it returns a 301 to /pricing, your lowercase rule works. The -I flag sends a HEAD request, which some servers answer differently from GET (see HEAD vs GET for crawler testing); use curl -s -o /dev/null -w "%{http_code}\n" for a GET status if the results look odd.
Also check that internal links use the same form as your canonical URLs. Internal links and broken links covers how to find mismatches.
Frequently asked questions
Are hyphens or underscores better in URLs?
Hyphens. Google recommends them because they clearly signal a word boundary, and it discourages underscores and joined words. Underscores are valid URL characters, but Google's documentation prefers hyphens.
Do keywords in the URL help rankings?
Google's SEO Starter Guide says keywords in the domain name or URL path alone have hardly any effect beyond appearing in breadcrumbs. Use descriptive slugs because they are clearer for people, not to expect a ranking gain.
Does URL case matter?
Yes. Google treats URL paths as case-sensitive, so /Apple and /apple are different URLs. Publish one case, preferably lowercase, and make other versions redirect to it or canonicalize to it.
How many folders deep should a URL be?
Google does not document a limit or ideal depth. Group pages by topic when it helps people, and for large sites it can also help Google learn how often each group changes.
Should I remove stop words from slugs?
Google's documentation does not address stop words. Shorter slugs are easier to read, but keep any word that makes the slug unclear.
Check your own pages
Run the free check on one page to see how its canonical URL and redirect behavior look to crawlers, with no account needed. If you suspect duplicate URLs across a whole site, an audit covers up to 500 pages and lists prioritized fixes.
Filed under Structure and schema. Topics: canonical, internal-links, google, checklist