ZeroToWP
seoby Marvin Kweyu

WordPress Slug SEO: How to Write Perfect URL Slugs for Rankings

Share this article

Your URL slug is one of the first things Google reads about your page — and one of the first things users see in search results. A clean, keyword-rich slug signals relevance. A messy, auto-generated one wastes a ranking opportunity you’ll never get back (at least not without a redirect).

Here’s how to write SEO-friendly slugs in WordPress, plus how to safely change existing ones.

What Is a Slug in WordPress?

The slug is the editable part of your URL that comes after your domain name. In zerotowp.com/wordpress-slug-seo, the slug is wordpress-slug-seo.

WordPress auto-generates a slug from your post title when you first create a page or post. A title like “How to Install WordPress on Your New Hosting Account” becomes how-to-install-wordpress-on-your-new-hosting-account — which is too long and includes unnecessary words. That’s why you should always edit it manually.

The slug is part of your permalink (the full permanent URL). Once a page is published and indexed by Google, changing the slug changes the URL — which is why getting it right the first time matters.

Why Slugs Matter for SEO

Three reasons your slug impacts rankings and traffic:

  1. Google uses it as a ranking signal. Google has confirmed that words in the URL are a relevance signal. A slug containing your target keyword tells Google what the page is about before it even reads the content.
  2. Users see it in search results. Google displays the URL (including slug) in search results. A readable slug like /best-wordpress-themes builds trust. A garbled one like /p=4827 or /2026/03/22/my-latest-post-about-stuff does not.
  3. Shorter URLs correlate with higher rankings. A Backlinko study of 11.8 million Google results found that shorter URLs tend to rank higher. The top-ranking results had URLs averaging 66 characters. Every unnecessary word in your slug works against you.

7 Best Practices for WordPress SEO Slugs

1. Include Your Primary Keyword

Your slug should contain the main keyword you’re targeting. For a post about WordPress caching, the slug should be /wordpress-caching-guide — not /everything-you-need-to-know-about-making-your-site-faster.

Good: /best-wordpress-themes
Bad: /my-favorite-themes-for-wp-sites-updated-march

For more on keyword placement, see our guide on adding SEO keywords in WordPress.

2. Keep It Short (3–5 Words)

Aim for 3–5 words in your slug — roughly 30–50 characters. Strip everything that doesn’t add meaning or keywords.

Title: “How to Improve Your WordPress SEO Score: 10 Proven Steps”
Slug: /improve-wordpress-seo (3 words, 21 characters)

3. Use Hyphens, Not Underscores

Google treats hyphens (-) as word separators but treats underscores (_) as word joiners. wordpress-seo is read as two words; wordpress_seo is read as one. WordPress uses hyphens by default, so this is mainly a concern when importing content from other systems.

4. Remove Stop Words

Words like “a,” “the,” “is,” “and,” “in,” “for,” “to,” and “how” add length without adding SEO value. Remove them.

Title: “What Is the Best WordPress Theme for SEO?”
Bad slug: /what-is-the-best-wordpress-theme-for-seo (8 words)
Good slug: /best-wordpress-theme-seo (4 words)

5. Use Lowercase Only

WordPress automatically converts slugs to lowercase, so this is handled for you. But if you’re migrating content from another CMS or creating redirects manually, always use lowercase. Some servers treat /WordPress-SEO and /wordpress-seo as different URLs, which creates duplicate content issues.

6. Avoid Dates & Numbers (Usually)

A slug like /best-seo-plugins-2026 will look outdated in 2027, and you’d need to either live with it or redirect. Instead, use /best-seo-plugins and put the year in the title tag (which is easy to update annually).

Exception: Date-prefixed slugs make sense for news articles (like /2026-03-22-events-calendar-vulnerability) where the date is part of the story’s identity.

7. Make It Readable & Descriptive

A human should be able to read the slug and know what the page is about. This builds trust in search results and makes your URLs shareable.

Readable: /wordpress-speed-optimization
Not readable: /post-7832-cat-4-tag-speed

How to Edit a Slug in WordPress

In the Block Editor (Gutenberg)

  1. Open any post or page in the editor
  2. Click the Settings icon (gear) in the top-right toolbar
  3. In the Post/Page tab, find the “URL” section (sometimes labeled “Permalink”)
  4. Click the URL to edit the slug
  5. Type your optimized slug (lowercase, hyphens, no stop words)
  6. Click Update or Publish

In the Classic Editor

Below the title field, you’ll see the permalink with an “Edit” button. Click it, modify the slug, and click “OK.”

Bulk Editing Slugs

Go to Posts → All Posts, hover over a post, and click “Quick Edit.” You can change the slug inline without opening the full editor. Useful for cleaning up many posts at once — but remember to set up redirects if any of these posts are already indexed.

How to Safely Change an Existing Slug

Changing a slug on a published, indexed page is risky. The old URL will return a 404 error, and you’ll lose all the SEO value (rankings, backlinks, social shares) accumulated on that URL. Always set up a 301 redirect.

Step-by-step:

  1. Note the current URL before changing anything
  2. Edit the slug to your new, optimized version
  3. Set up a 301 redirect from the old URL to the new one using:
    • Rank Math (free built-in redirect manager)
    • Yoast Premium (auto-creates redirects on slug change)
    • The free Redirection plugin
  4. Update internal links across your site that pointed to the old URL
  5. Resubmit your sitemap in Google Search Console
  6. Monitor Search Console for the next 2 weeks to ensure Google picks up the change

When NOT to change a slug: If the page already ranks well and gets traffic, leave it alone. A suboptimal slug on a page ranking #3 is better than a perfect slug on a page that temporarily drops to #30 during re-indexing.

Your permalink structure (Settings → Permalinks) determines the base pattern for all URLs on your site. Here are your options:

  • Plain (?p=123) — ❌ Terrible for SEO. No keywords, not human-readable.
  • Day and name (/2026/03/22/post-name/) — ⚠️ Adds unnecessary date. Makes content look dated.
  • Month and name (/2026/03/post-name/) — ⚠️ Same problem, slightly shorter.
  • Numeric (/archives/123) — ❌ Same problem as Plain.
  • Post name (/post-name/) — ✅ Best for SEO. Clean, short, keyword-friendly.
  • Custom (/%category%/%postname%/) — ⚠️ Only if your category structure is critical to your content architecture. Adds URL depth without clear SEO benefit for most sites.

Recommendation: Use “Post name” unless you have a specific architectural reason for something else. It’s what we use on ZeroToWP, and it’s what Google recommends in their URL structure guidelines.

Frequently Asked Questions

Does changing a slug hurt SEO?

It can, temporarily. Changing a slug changes the URL, which means Google needs to re-index the page at its new address. Without a 301 redirect, the old URL returns a 404 and you lose all accumulated rankings and backlinks. With a proper redirect, the damage is minimal — expect a brief dip in rankings (days to weeks) while Google processes the change.

“Post name” (/your-slug/). It’s the shortest, cleanest option and puts your keyword-rich slug directly after the domain. Avoid date-based structures unless you run a news site. See our SEO improvement guide for the full permalink setup.

Should I include categories in my URL?

Generally no. Adding categories (/seo/wordpress-slug-guide/) increases URL length without a proven ranking benefit. It also creates problems if you ever reorganize categories — every affected URL changes. Stick with /post-name/ for simplicity.

How long should a WordPress slug be?

3–5 words (30–50 characters). Short enough to be readable and memorable, long enough to include your target keyword. Google doesn’t penalize longer URLs, but data consistently shows shorter URLs correlate with higher rankings.

Can I use the same slug for a page and a post?

No. WordPress enforces unique slugs across all content types. If you try to use a slug that’s already taken, WordPress appends -2 to the new one (e.g., /about-2). This is by design — duplicate URLs would create confusion for both users and search engines.

Does the slug automatically update when I change the title?

Only for unpublished drafts. Once you publish a post, the slug is locked even if you change the title. This is a safety feature — WordPress protects you from accidentally changing a live URL. To update the slug after publishing, you must edit it manually in the post settings.

MK

Written by Marvin Kweyu

Our team tests and reviews WordPress products to help beginners make confident choices.

Learn more about our team →

You might also like

Leave A Reply

Thanks for choosing to leave a comment. All comments are moderated, and your email address will NOT be published. Please do NOT use keywords in the name field.