What is a URL Slug?
On-Page SEO
The URL slug is the part of your URL that comes after your domain name. For a post at example.com/how-to-write-headlines, the slug is how-to-write-headlines.
Slugs make URLs readable and memorable. A good slug tells readers and search engines what the page contains before they even click.
Why URL slugs matter
Your slug is visible in search results, browser address bars, and when people share your link. It's part of your page's first impression.
For SEO
Google uses your slug as a relevance signal. A slug that contains your target keyword reinforces what the page is about. It's not the strongest ranking factor, but it's one more signal that helps.
A post targeting "blog post structure" should have a slug like /blog-post-structure or /how-to-structure-a-blog-post. Clear and descriptive.
For users
Clean slugs build trust. Compare these:
Bad: example.com/p=12345?cat=blog&ref=home
Good: example.com/how-to-write-headlines
The good slug is readable, memorable, and tells you what you're about to click. The bad slug looks automated and suspicious.
How to create good slugs
Keep slugs short, descriptive, and keyword-focused. Remove unnecessary words. Use hyphens to separate words.
Start with your title
Your post title usually makes a good starting point. If your title is "How to Write Blog Post Headlines That Get Clicks," a good slug might be how-to-write-blog-post-headlines or just blog-post-headlines.
You don't need to include every word from the title. Focus on the main keyword.
Use hyphens, not underscores
Words should be separated by hyphens (-), not underscores (_). Google treats hyphens as spaces but treats underscores as connecting characters.
Right: blog-post-headlines
Wrong: blog_post_headlines
Keep it concise
Shorter slugs are easier to read and remember. Aim for 3-5 words that capture the main topic.
Too long: how-to-write-blog-post-headlines-that-actually-get-people-to-click-without-clickbait
Better: how-to-write-blog-post-headlines
Use lowercase
Always use lowercase letters in slugs. Some servers treat Blog-Post and blog-post as different URLs, which can cause duplicate content issues.
What to avoid in slugs
Don't include stop words (a, the, and, or, but) unless they're part of your keyword. how-to-write-headlines works better than how-to-write-the-headlines.
Don't use special characters (?!@#$%^&*). Stick to letters, numbers, and hyphens.
Don't include dates unless they're relevant to the content. /2024-blog-trends makes sense. /2024-how-to-write-headlines doesn't - good headline advice doesn't expire.
Changing slugs later
Once a URL is published and indexed, changing the slug can hurt SEO. The old URL will break unless you set up a 301 redirect.
If you must change a slug, redirect the old URL to the new one. But it's better to get it right the first time.
Slug length and SEO
There's no official character limit for slugs, but shorter is generally better. Google truncates long URLs in search results, showing only the first ~60 characters.
More importantly, short slugs are easier for humans to process. If someone shares your link in a message or email, a readable slug looks professional.
Platform defaults
Most blog platforms generate slugs automatically from your post title. WordPress, for example, takes your title, converts it to lowercase, replaces spaces with hyphens, and removes special characters.
You can usually edit the slug before publishing. Take a moment to shorten it if needed and ensure it includes your main keyword.
Put this knowledge into practice
PostGenius helps you write SEO-optimized blog posts with AI — applying concepts like this automatically.