Skip to content

On-page SEO

What is a URL slug? Definition, examples, and how to write one for SEO

URL slugs are the part of a web address that names one specific page, usually the words after the last slash, as in example.com/blog/descale-espresso-machine. A good slug is short, lowercase and readable, with words separated by hyphens, so people and search engines can tell what the page is before they open it.

Last reviewed October 12, 2026 · 7 min read

Reviewed by Yurii, Founder of Structura

Most site owners first meet the word in WordPress, where every post and page has a slug you can edit. It matters less for rankings than its reputation suggests, and more for the people who read, share and link to the address.

The anatomy of a URL

Take this address: https://www.example.com/blog/descale-espresso-machine?utm_source=newsletter#step-3

Part In the example What it does
Protocol https:// How the browser connects; HTTPS encrypts the connection
Domain www.example.com Identifies the site
Path /blog/ The section, or folder, the page sits in
Slug descale-espresso-machine Identifies the page within that section
Parameters ?utm_source=newsletter Extra data for tracking, sorting or filtering; not part of the slug
Fragment #step-3 A position on the page; not part of the slug

So the difference between a slug and a URL is part and whole. The URL is the full address. Change the slug and the URL changes with it; move the page to another domain or folder and the URL changes while the slug can stay the same.

What Google says about URL slugs

Google's URL guidance is short, and most of it applies to slugs directly:

  • Use words, not IDs. "When possible, use readable words rather than long ID numbers in your URLs." The SEO Starter Guide adds why: parts of the URL can appear in results as breadcrumbs, "so users can also use the URLs to understand whether a result will be useful for them."
  • Separate words with hyphens. Google recommends "using hyphens (-) instead of underscores (_) to separate words in your URLs, as it helps users and search engines better identify concepts in the URL." Words run together, as in greendress, are on its list of styles not to use.
  • Pick one case. "Google treats both /APPLE and /apple as distinct URLs with their own content." If your server answers on both, you have the same page at two addresses, which is a small case of duplicate content. Lowercase everything.
  • Write in your readers' language. Google asks for "words in your audience's language in the URL," transliterated where that applies, and for non-ASCII characters to be percent-encoded in links, which most CMSs handle for you.

On keywords, Google is blunt. The Starter Guide says keywords in the domain name or URL path "alone have hardly any effect beyond appearing in breadcrumbs." A slug that names the topic helps a reader decide to click; it will not lift a page that does not deserve to rank.

How long should a URL slug be?

Google's URL guidance sets no length to aim for. It points in one direction, though: readable words, and "as few parameters as you can," shortening URLs by trimming the ones that do not change the content. Ahrefs adds a practical reason to keep slugs short: "long URLs often get truncated in the search results."

In practice, three to five words cover most posts. The slug should be long enough to say what the page is and no longer: descale-espresso-machine says as much as how-to-descale-your-espresso-machine-at-home-step-by-step and survives being pasted into a message.

How to write a URL slug

  1. Start from the page's primary keyword, not its title. Ahrefs' shortcut: "If you were to describe your page in a few words and replace the spaces with hyphens, that would usually be 'good enough' for SEO." The keyword you chose for the page is usually those few words; keywords per page covers choosing it.
  2. Cut what will date. Numbers and years belong in titles, which are easy to change. Ahrefs' example: a "4-step process" post that later gains a fifth step needs a new URL and a redirect if the number is in the slug.
  3. Drop filler words when the meaning survives. "A", "the", "and" and "of" can usually go. Keep a word when removing it changes the meaning.
  4. Lowercase, hyphens, no punctuation. Commas, quotes, colons and spaces make addresses harder to share and parse.
  5. Check it is unique on purpose. If another page already has a near-identical slug, two pages may be chasing one query, which is keyword cannibalization, and that needs fixing before the slug does.

Write the slug once the outline is settled, so it names what the finished post covers; blog post structure covers the outline itself.

URL slug examples

Page Weak slug Better slug What changed
How to descale an espresso machine (2026 guide) how-to-descale-an-espresso-machine-2026-guide descale-espresso-machine Year and filler removed
7 ways to fix a leaky faucet 7-ways-to-fix-a-leaky-faucet fix-leaky-faucet Count removed, so the post can grow
Quartz vs granite countertops ?p=4183 quartz-vs-granite-countertops Words instead of an ID
Summer clothing guide Summer_Clothing_Guide summer-clothing-guide Lowercase, hyphens
Green dresses greendress green-dresses Words separated
Blog post ideas, on /blog/ blog/blog-post-ideas-for-your-blog blog/blog-post-ideas Repetition removed

Dates deserve a note of their own. Some permalink settings put the publication date in every post URL. Ahrefs points out that this "can cause issues if you ever update your content," and advises choosing a dateless structure before a new site publishes anything, but leaving an established site's structure alone.

URL slugs in WordPress

WordPress builds the slug from the title. Its documentation explains that punctuation "and invalid URL characters are removed and spaces are substituted with dashes," and its example turns a title full of commas and apostrophes into my-site-heres-lookin-at-you-kid, which you can shorten by hand before publishing. The slug is edited in the post's settings, and the URL around it comes from Settings, then Permalinks. Our walkthrough on writing a blog entry in WordPress covers that step as part of publishing.

Changing a slug after publishing is safer for posts than for pages. WordPress records a post's old slugs, and when someone requests one, its old-slug function finds the post and sends a 301, which the code marks as a "Permanent redirect." The same function exits early for hierarchical post types, and pages are hierarchical, so a renamed page's old address breaks unless you add a redirect yourself. Either way, Ahrefs' advice holds: "There's rarely much point changing existing URL slugs." Change one when it is wrong, then update your internal links to the new address.

How Structura handles this

Structura writes a slug for every post. On paid plans it contains the post's exact focus keyphrase, hyphenated, aims for three to five words and at most 75 characters, uses only lowercase letters, numbers and hyphens, and leaves out dates, categories and filler words such as "a", "the", "and" and "of". On the Free plan the same rules apply without the keyphrase requirement. A slug that comes back empty or malformed is rebuilt from the title before delivery.

On WordPress, the slug goes into the post's own slug field, and your permalink settings decide the rest of the URL. Structura also keeps a record of the slugs it has published on your site: a scheduled post that would reuse one is stopped before delivery, and you get a notice that the campaign needs new keywords. Posts you request yourself are delivered anyway, and WordPress gives them a numbered slug. On headless sites, slugs are unique per site: when one is taken, the new post gets -2, -3 and so on, accented letters become plain ones, and a trashed post no longer holds its slug.

Structura does not change slugs on posts you wrote yourself, and it does not set up redirects; if you rename a Structura post later, WordPress or your front end handles the old address. The blog SEO software page lists what else each post arrives with.

FAQ

What is a slug in WordPress?

In WordPress, the slug is the editable part of a post's or page's URL that names it, set in the post's settings in the editor. WordPress generates it from the title by removing punctuation and replacing spaces with hyphens, and you can shorten it before publishing. Categories and tags have slugs too, which form the last part of their archive URLs.

Does URL length matter for SEO?

Not as a ranking factor that Google documents. Google's URL guidance asks for readable words and as few parameters as possible, and gives no length to aim for. Shorter slugs still win in practice, because long URLs are more likely to be cut off in search results and are harder to read, share and remember.

Should I change my URL slugs for SEO?

Rarely. A slug's keywords have little ranking effect, and every change creates an old address that needs a redirect, so rewriting working slugs usually costs more than it gains. Change a slug when it is misleading or contains a number or year that is now wrong, make sure the old URL redirects, and update your own links to point at the new one.

Share this post