explainers

URL Slug: Best Practices for SEO and Sharing (2026 Guide)

A URL slug is the human-readable ID at the end of a web address. Learn what slugs are, the SEO rules that actually matter, and how to write ones that rank and get clicked.

Team U2L 22 min read

You're about to publish a blog post. The CMS auto-generates a URL that looks like yoursite.com/the-ultimate-2026-guide-to-what-a-url-slug-is-and-why-it-matters-for-your-website-seo. You hit publish anyway because it's late and you want to move on. Six months later that ugly URL is the one Google indexed, the one every backlink points at, and the one you can't quietly rename without wrecking your rankings.

The URL slug is one of those quiet decisions that costs nothing to get right and a lot to get wrong. Publishers who care about search traffic, click-through rate, and shareability treat it as a small craft. Publishers who don't end up with URLs that read like keyword vomit and slugs that quietly leak clicks in every search result.

This guide covers what a URL slug actually is (there's more confusion here than you'd expect), the SEO rules that genuinely move the needle in 2026, how to write slugs that Google and humans both like, how to change a slug without destroying your traffic, platform-specific quirks (WordPress, Shopify, Ghost, Webflow), and how slugs interact with the wider URL structure and short-link layer of a site. Read this once and you'll never have to think about it again.

A URL slug is the human-readable part at the end of a URL that identifies a specific page. In https://example.com/blog/url-slug-best-practices, the slug is url-slug-best-practices. Good slugs are short, all lowercase, use hyphens to separate words, include the target keyword, and describe the page content clearly. They stay the same after publish so bookmarks, backlinks, and rankings keep working.

A URL slug is the portion of a URL that comes after the domain (and any subdirectory) and uniquely identifies a specific page or piece of content. Slugs are usually written in lowercase, use hyphens between words, and are chosen to be short and descriptive so both search engines and humans can tell what the page is about before clicking.

Table of Contents

What a URL Slug Actually Is

A URL slug is the human-readable identifier that comes at the end of a web address and tells you (and Google) which specific page you're looking at. In https://example.com/blog/url-slug-best-practices, the slug is the url-slug-best-practices bit. Everything before it - the protocol, the domain, the blog subdirectory - stays the same across every post on the site. The slug is the piece that changes per page.

The word "slug" comes from old newspaper composing rooms, where the "slug line" was the short label editors used to identify a specific article as it moved through the production pipeline. Modern content management systems borrowed the term because a URL slug does the exact same job: it's a short label that identifies one specific piece of content in the whole system.

Most CMSs generate a slug automatically the first time you publish a page. WordPress takes your post title, drops the stop words, lowercases everything, and joins the rest with hyphens. Ghost and Webflow do something similar. That's usually a fine starting point, but the auto-generated version is rarely optimal - it's often too long, contains words that don't help, and sometimes includes an unhelpful number suffix if you have two similar titles. Editing the slug before you publish takes ten seconds and pays off for the entire lifetime of the URL.

One thing to get straight: the slug is not the same as the full URL, not the same as the permalink, and not the same as the path. It's a specific piece of the URL. Getting this vocabulary right matters because SEO documentation and CMS UIs use these terms with real precision, and mixing them up leads to fuzzy thinking and worse decisions.

These four terms get thrown around like they're interchangeable. They're not. Here's the clean version.

Term What It Is Example
URL The full web address, protocol to fragment https://example.com/blog/url-slug-best-practices?utm_source=nl#section-2
Permalink The stable canonical URL of a specific page https://example.com/blog/url-slug-best-practices
Path Everything after the domain /blog/url-slug-best-practices
Slug The unique identifier at the end of the path url-slug-best-practices

The slug is a subset of the path, which is a subset of the permalink, which is a subset of the URL. If someone tells you to "change the slug," they mean edit just that last piece. The domain and subdirectory stay put. If they say "change the permalink," they usually mean the same thing, but they might also mean restructuring the URL more broadly. If they say "change the URL," they could mean anything from a slug tweak to a full domain migration - ask which.

For a deeper walkthrough of the wider URL layer and why the "permanent" part matters, our permalink guide covers how the anatomy fits together and why casual URL changes are one of the most expensive mistakes a publisher can make.

Do URL Slugs Really Affect SEO?

Yes, but less than SEO Twitter would have you believe. The honest answer is that slugs are a small ranking signal that also influences click-through rate in search results, and click-through rate is a much bigger deal than the direct ranking effect.

Here's the breakdown of what actually happens.

Direct ranking impact: small. Google has been public about this for years. In multiple Search Central videos and podcasts, John Mueller has called the words in the URL a "very small ranking factor" and warned people not to obsess over it. He's not being coy - the algorithm mostly cares about the content on the page, not the words in the address bar.

Indirect impact via CTR: bigger. When someone scans a page of search results, they read the title, the description, and the URL. A clean, descriptive slug (/blog/url-slug-best-practices) reads like a promise. An ugly one (/?p=8471&cat=42) reads like a warning label. The clean slug earns more clicks. Google notices high click-through rates and rewards them over time. That's where the real gain lives.

Impact on shareability: huge. People share URLs in tweets, Slack messages, Discord threads, email, podcasts, and print. A slug like url-slug-best-practices is scannable, retypable, and immediately meaningful. A slug like ?p=8471 is none of those things. Every unclear URL you publish is a small tax on every person who tries to share it.

The takeaway is not that slugs are irrelevant - it's that the value of a good slug shows up in CTR and shareability more than in direct rankings. Focus on writing slugs a human would want to click, and Google's algorithm will end up rewarding you anyway.

Google's own URL structure documentation is direct on the same point: use descriptive words, keep URLs simple, avoid IDs and query parameters where you can. Follow that guidance and you're already ahead of most sites.

The 10 URL Slug Best Practices Worth Following

The rules below are the ones that actually pay off. Skip the folklore about hyphen-count minimums and character-limit fetishes - most of that is copied from 2012 blog posts that nobody has updated.

  1. Use lowercase only. URLs are technically case-sensitive on most servers. /About and /about can serve different pages. Always publish in lowercase to avoid duplicate-URL headaches and canonical mistakes.
  2. Separate words with hyphens, not underscores. Google treats hyphens as word separators and underscores as joiners. url-slug-guide reads as three words. url_slug_guide reads as one weird string. Hyphens win every time.
  3. Include the target keyword. The slug should contain the primary keyword you're targeting. Not stuffed with variants, just one clean instance. url-slug-best-practices is right; best-url-slug-tips-for-seo-in-2026-slugs-guide is not.
  4. Keep it short: 3 to 5 meaningful words. That usually lands you between 30 and 60 characters. Google truncates the URL in search results past roughly 60-70 characters, so anything longer starts getting cut off in the exact place it needs to be readable.
  5. Cut the stop words. a, an, the, and, or, of, for, in, on, with, to add characters without adding meaning. how-to-write-a-slug becomes how-to-write-slug. the-best-guide-to-permalinks becomes best-permalinks-guide. Read the trimmed version - it still parses.
  6. Skip dates in evergreen slugs. /blog/2026/03/url-slug-guide looks stale the moment the year turns. /blog/url-slug-guide doesn't visibly age. Only bake dates into slugs when the date is genuinely part of the content's identity (news, event coverage, annual reports).
  7. Avoid special characters and non-ASCII. Emojis, accented characters, spaces, ampersands, question marks - all technically possible but all cause problems. They URL-encode into gibberish (caf%C3%A9), break in some email clients, and read badly in print. Stick to a-z, 0-9, and hyphens.
  8. Don't stuff keywords. url-slug-slug-tips-for-slugs is transparent spam. Google's spam systems downrank it, and readers scroll past it. One clean use of the keyword is enough.
  9. Match the intent, not just the title. If your post is titled "10 Ways to Speed Up Your WordPress Site," the slug can be speed-up-wordpress. You don't need every word from the title. Ask what someone searching for this content would type - use that as the slug.
  10. Pick it once and don't change it. The best slug is a stable one. Every URL change costs you backlinks, bookmarks, rankings, and internal-linking clarity. Spend an extra 30 seconds up front rather than a week doing damage control later.

These ten rules cover about 95% of what matters. The remaining 5% is platform-specific quirks and edge cases (which we get to below).

How to Write a Great Slug in 60 Seconds

Every time you publish a page, run through this quick sequence. It becomes automatic after a few tries.

  1. Start with the target keyword. What is this page fundamentally about? Type that. url slug.
  2. Add one or two qualifying words if needed. What angle does this page take? For a best-practices post, add that: url-slug-best-practices. For a definition, what-is-a-url-slug. For a how-to, how-to-write-url-slug.
  3. Lowercase everything. Replace spaces with hyphens. Most CMSs do this for you but check.
  4. Read it out loud. If it sounds like a phrase you could actually say ("URL slug best practices"), you're good. If it sounds like keyword soup ("URL slug best practices tips for SEO 2026 guide"), trim.
  5. Check for duplicates. If another post on your site already uses this slug, either differentiate it clearly or update the older post's angle. Two similar slugs on the same site cannibalize each other in search.
  6. Publish. Do not touch it again.

The whole loop takes under a minute. The gain is a slug you'll be happy with in five years, not just at 11pm on publish day.

Slug Formatting Rules by Character

Every character in a slug has a specific behavior in browsers, servers, and search engines. Some are safe, some are risky, some are outright broken. Here's the practical reference.

Character Type Safe? Notes
Lowercase letters a-z Yes The core of every good slug
Numbers 0-9 Yes Fine as identifiers or years when relevant
Hyphen - Yes The correct word separator
Underscore _ Avoid Search engines treat as a word joiner, not separator
Uppercase letters Avoid Case-sensitivity issues, publish lowercase
Space No Auto-encodes to %20, ugly in URLs
Ampersand & No Reserved for query strings, breaks parsing
Question mark ? No Reserved for query strings
Slash / Only as path separator Do not put in the slug itself
Special characters (@, #, !, +) No Reserved, encoded, or ambiguous
Emojis and non-ASCII No Technically allowed, practically a mess
Accented characters (é, ñ) Avoid URL-encodes to unreadable strings

The safe alphabet is [a-z0-9-]. If you stick to that and never use two hyphens in a row, your slugs will work everywhere: browsers, email clients, PDF readers, screen readers, chat apps, and printed materials.

One subtle point about numbers: they're fine, but avoid arbitrary IDs (/post-8471) unless they're structurally meaningful. Numbers that carry meaning (a year, a version, a chapter) are useful. Random numeric suffixes just add noise.

URL Slug Examples: Good, Bad, and Ugly

Concrete examples land the rules better than abstract ones. Here's a spread across a few common content types.

Blog post about SEO for beginners:

  • Good: seo-for-beginners
  • Bad: the-ultimate-2026-guide-to-search-engine-optimization-for-complete-beginners-and-experts
  • Ugly: ?p=42&cat=seo

E-commerce product page for a men's leather wallet:

  • Good: mens-leather-wallet
  • Bad: product-mens-leather-wallet-brown-genuine-full-grain-with-rfid-blocking-2026-edition
  • Ugly: products/8471-v3-final-final

Landing page for a spring promotion:

  • Good: spring-sale
  • Bad: spring-sale-promotion-limited-time-only-save-big-on-selected-items
  • Ugly: ?promo=SPR2026&aff=nl

News article about a company acquisition:

  • Good: acme-acquires-widgetcorp (or 2026/03/acme-acquires-widgetcorp for news)
  • Bad: breaking-news-acme-just-acquired-widgetcorp-in-a-shock-deal-heres-everything-you-need-to-know
  • Ugly: article-view.php?id=8471

Documentation page for an API endpoint:

  • Good: api/links/create
  • Bad: api-documentation-how-to-create-a-new-link-via-the-rest-api-endpoint-full-guide
  • Ugly: docs.php?section=api&topic=links&action=create

The pattern across every category is the same: the good version reads like a phrase a human would say. The bad version reads like an SEO robot chewed the title. The ugly version reads like an old database dump.

Platform-Specific Slug Notes

Every major CMS handles slugs slightly differently. Here are the quirks worth knowing.

WordPress. WordPress auto-generates a slug from the post title, converting it to lowercase and joining words with hyphens. You can edit it directly in the block editor's URL panel or via Quick Edit from the Posts list. The site-wide URL structure lives under Settings → Permalinks. For most blogs, the "Post name" option is the right pick (recommended by Yoast, Rank Math, and every serious WordPress SEO plugin). If you change a slug on a published post, WordPress does not auto-create a 301 redirect - you need the Redirection plugin or a similar tool.

Shopify. Shopify calls the slug the "URL handle" and auto-generates it from the product, collection, or blog post title. You edit it in the SEO section of the item's admin page. Shopify auto-generates a 301 redirect from the old URL to the new one when you change a handle, which is one of the nicer default behaviors on any platform. Product URLs get prefixed with /products/ and collection URLs with /collections/ - you can't strip those prefixes on the standard plans.

Ghost. Ghost uses the term "URL" directly in the post settings panel. Slugs default to a lowercased, hyphenated version of the title. Ghost handles slug changes gracefully - old URLs return a 301 redirect automatically. Ghost's admin lets you edit the slug at any time without additional plugins.

Webflow. Webflow uses "slug" as the field name in each Collection item and the CMS settings. Slugs auto-generate from the item name. When you rename a slug on a published item, Webflow prompts you to add a 301 redirect from the old URL to the new one - do it. There's a redirect table in site settings for managing all of these.

Squarespace. Slugs are called "URL slugs" in the page settings panel. Auto-generated from the page or post title. Editing a slug on a published page does not automatically create a redirect - you have to add one manually in the URL Mappings section of site settings.

Notion. Public Notion pages use a slug plus a hash suffix (page-title-abc123def456). You can't get a clean slug on a raw Notion URL, which is why most people use a static site generator on top of Notion for anything they care about SEO for.

If you're on a headless setup (Next.js, Astro, Hugo, Jekyll, Gatsby), the slug is whatever you put in the frontmatter or the filename. That gives you total control and total responsibility - there's no CMS guardrail catching a bad slug for you.

How to Change a URL Slug Without Killing Your Rankings

Sometimes you have to change a slug. Maybe you spotted a typo, rebranded a product, or realized the original slug was targeting the wrong keyword. Do it wrong and you'll wipe out backlinks and rankings. Do it right and the transition is basically invisible to Google and users.

The right way, step by step:

  1. Decide on the new slug. Pick something you'll be happy with in five years, not just this quarter. Apply every best practice from earlier in this article.
  2. Update the slug in your CMS. WordPress: edit the URL field in the block editor. Shopify: edit the URL handle in the SEO panel. Ghost/Webflow: edit the slug field directly.
  3. Set up a 301 redirect from the old slug to the new one. This is the critical step. A 301 tells search engines the URL has moved permanently and passes roughly all of the accumulated SEO equity to the new location. Skip this and every existing backlink and bookmark starts pointing at a 404. Our 301 vs 302 redirects guide covers why 301 is the right status code here.
  4. Update internal links across your site. Redirects work, but a direct link is always slightly faster and cleaner. Find every internal link to the old slug and repoint it at the new one.
  5. Request re-indexing in Google Search Console. Submit the new URL through the URL Inspection tool so Google finds it faster.
  6. Test in a private browser window. Load the old slug and confirm the redirect fires with a 301 status code (browser dev tools will show it under the Network tab).

The gotcha most publishers hit: they treat redirects as temporary. They set up a 301 in year one, and in year three someone cleans up "old" redirect rules and the whole chain snaps. 301 redirects need to live forever. Once you commit to redirecting a URL, you're committing to keep that redirect alive as long as the site exists.

The other gotcha: chained redirects. If URL A redirects to URL B and URL B later redirects to URL C, always update A to point directly at C. Chains slow down the first-click experience and slightly dilute SEO equity at every hop.

A URL slug lives on your own domain. A short-link alias lives on a shortener's domain. They serve different purposes but the naming rules overlap almost completely.

When you paste https://example.com/blog/url-slug-best-practices into a URL shortener, you can either accept a random string (u2l.ai/aB9xY2) or type a custom alias (u2l.ai/slug-guide). That custom alias is essentially a slug on the shortener's domain - all the same best practices apply. Keep it lowercase, use hyphens, make it descriptive, keep it short, don't stuff keywords.

The one difference is scarcity. On your own domain, you own every possible slug. On a shared shortener, slugs are first-come, first-served. If someone else grabbed u2l.ai/pricing before you, you'll need a variation. That's part of why serious brands eventually move to a custom short domain - once you own yourbrand.co, every possible alias under it is yours forever.

The other thing to know: short links wrap slugs, they don't replace them. Google should always index your permalink (example.com/blog/url-slug-best-practices), not the shortener redirect. Use short links for external channels (social, podcasts, print, QR codes) where the raw URL is too long or ugly to share. If you're linking from one of your own pages to another, always use the full canonical URL - never the short link.

For the practical setup, how to create a custom short URL walks through picking a good alias in three steps, and what is a branded link covers why moving to your own short domain lifts click-through rate by roughly a third. You can also try it right now with no login - paste any URL at the U2L AI URL shortener and pick your own alias.

If you're building a broader mental model of URL layers, our what is URL shortening explainer walks through the redirect layer from scratch, and the complete link tracking guide covers how slugs, UTMs, and analytics fit together in a campaign.

Frequently Asked Questions

What is a URL slug in simple terms?

A URL slug is the last part of a web address that identifies the specific page. In https://example.com/blog/url-slug-best-practices, the slug is url-slug-best-practices. It's usually a lowercase, hyphenated version of the page title.

What is a URL slug example?

A clean URL slug example is url-slug-best-practices inside https://example.com/blog/url-slug-best-practices. Other good examples: pricing, about-us, spring-sale, mens-leather-wallet. Each is short, all lowercase, and uses hyphens to separate words.

How long should a URL slug be?

Aim for 3 to 5 meaningful words, roughly 30 to 60 characters. Google truncates URLs in search results past about 60 to 70 characters, so anything longer risks being cut off exactly where readability matters most. Under 3 words is often too vague to help.

Should URL slugs contain keywords?

Yes, one clean instance of the primary keyword in the slug is a small but useful ranking signal and boosts click-through rate in search results. Do not stuff keywords or repeat variants - url-slug-slugs-guide-slugs is spam, url-slug-best-practices is right.

Are hyphens or underscores better in URL slugs?

Hyphens. Google treats hyphens as word separators and underscores as word joiners, so url-slug-guide reads as three words but url_slug_guide reads as one string. Always pick hyphens.

Do URL slugs affect SEO?

Yes, but modestly. Slugs are a small direct ranking signal (Google has said so publicly) and a larger indirect one via click-through rate. Descriptive slugs get more clicks in search results, and Google rewards pages with strong click-through over time. The main SEO risk is not slug wording but slug instability - changing slugs without proper 301 redirects wipes out rankings fast.

Can I change a URL slug after publishing?

Yes, but only with a 301 redirect from the old slug to the new one. Otherwise every backlink, bookmark, and search-engine reference to the old URL breaks. Some platforms (Shopify, Ghost) auto-create the redirect. WordPress and Squarespace require you to add it manually.

The permalink is the full canonical URL of a page (https://example.com/blog/url-slug-best-practices). The slug is only the identifying end piece of that permalink (url-slug-best-practices). Every permalink contains a slug, but the slug is not the whole permalink.

What is a WordPress slug?

In WordPress, the slug is the editable URL identifier for a post, page, category, or tag. WordPress auto-generates it from the title and lets you edit it in the block editor's URL panel or via Quick Edit on the Posts list. Change it under Settings → Permalinks for the site-wide URL structure.

Can URL slugs have numbers?

Yes, if the number carries meaning (a year, a version, a chapter number). Avoid arbitrary numeric IDs like post-8471 unless they're structurally required by your CMS. Random numbers add noise without adding meaning.

Should URL slugs include the date?

Only for news or time-specific content where the date is part of the story. For evergreen content (guides, how-tos, product pages, definitions), skip the date - a slug like url-slug-best-practices stays useful for years, while url-slug-best-practices-2026 forces a new URL every year.

Can URL slugs contain uppercase letters?

Technically yes, but you should always publish in lowercase. Most servers treat URLs as case-sensitive, so /About and /about can accidentally become two different pages, splitting rankings and causing canonical headaches. Consistency wins.

Get URL Slugs Right Once and Everything Downstream Gets Easier

URL slugs are one of those quiet decisions that compound. Get them right and every page you publish comes out of the CMS looking clean, ranking better in search results, and reading well when shared in social posts, podcasts, or QR codes. Get them wrong and every URL is a small drag on click-through, shareability, and long-term SEO stability.

The rules are simple: lowercase, hyphens, short, keyword-focused, descriptive, and stable after publish. Follow that pattern on every page and the slug layer of your site quietly stops being a problem you have to think about.

Ready to wrap your permalinks in clean short links for social, email, print, and QR codes? Sign up free at U2L AI and you'll get custom-alias short links, dynamic QR codes, link-in-bio pages, and analytics that show every click your pages earn. You can also shorten a URL with no login at the U2L AI URL shortener - pick your own alias in seconds.

If you want to keep going on the URL layer, what is a permalink explains the full URL anatomy and why "permanent" matters, how to create a custom short URL walks through the alias-picking process end to end, and 301 vs 302 redirects settles the question of which status code to use when you finally do have to change a URL.

Ready to try U2L AI?

Free forever plan. No credit card required.