Skip to content
SEOSpot
SEO

Optimizing URL Slugs for SEO Without Hurting Your Page Rankings

Ahsan SoomroAhsan SoomroHead of SEO11 min read
Optimizing URL Slugs for SEO Without Changing Your Page Rankings

URL changes are common and they are part of your business, it is like in a mart changing a shelf's position from one position to another, but if it is organized the visitor in your mart is informed that the earlier vegetable shelf you were looking for is now at the top right corner, so a URL is the same case, like when Google or any bot crawls it, it may not be that confused shop visitor who does not know where to go, because you have the setup to guide the spider.

Should You Change an Existing URL Slug?

Before editing any URL, I ask one question: is there a real SEO problem, or does the URL simply look imperfect?

A page ranking well with an older slug doesn't automatically need an update. Here's how I decide:

URL situationMy recommendation
URL ranks well and gets consistent trafficKeep it unchanged
Slug contains outdated or misleading informationConsider updating
URL has unnecessary words but performs wellUsually leave it alone
Multiple URLs create duplicate content issuesInvestigate canonicalization
New page hasn't been publishedOptimize before publishing
URL structure is changing during a migrationPlan redirects carefully

My tip: if a URL already performs well, I need a stronger reason to change it than simply making it shorter.

Now we justify the logic, let's say you published a page or a product page but it is carrying 2026 or 2025 in the URL, and a year in the slug is not valid forever right, so you might want to update it, or the slug has a typo you never noticed but you noticed it once it started receiving the traffic.

Now one thing is clear, do you see, it means Google never cared about the typo, but having grammar in the slug is also not a good thing even if Google is not caring, Google is not the Oxford of the internet.

Well, now coming to the agenda of the article, I will be covering two issues today, one is the guide to optimized URLs, as we are using LLMs a lot these days and our slugs are in their control, whatever title they create. And the second is managing the slugs without losing the page rankings, like during migrations (again the LLM is here, like you were using WordPress, after Claude Code you are an overnight developer and you migrated your site to NUXT, NEXT or maybe ASTRO) or the editing of slugs, right.

Optimize URL Slugs for SEO

Now the tips that I am giving are not just my random thoughts but suggestions from URL structure best practices for Google Search and the industry's regular practice.

The most common optimization concern, should my keyword be in the slug?

Yes if needed, like you are creating the entire page about a specific product so obviously with or without need it will be part of the URL, like don't think of it as an SEO practice, even if you think from a basic sensible point of view it is needed so add it, it's the SEO fuss that makes it confusing else nothing, if it is needed use it, if not avoid it, but don't over force multiple keywords into one slug.

A relevant keyword helps describe the page. For an article targeting "technical SEO checklist," I'd consider:

example.com/technical-seo-checklist

I wouldn't use:

example.com/technical-seo-checklist-seo-audit-technical-seo

Repeating keywords makes the URL harder to read without providing a meaningful benefit. Google is smart enough to understand it, and for a second leave it, because nowadays even from the Google SERP they have become goto URLs, open Chrome and you would barely see a full URL, because of the AI scrapers and SERP scrapers Google has put a veil on it, so once a URL is opened see it on a mobile phone, is any person or you in Chrome able to see the full URL, no, so from this sense it's of no use.

By the way:

Mueller on Twitter: "Keywords in URLs are overrated for Google SEO. Make URLs for users." And in 2021 he called words in a URL a "very very lightweight factor" that mainly helps before Google has even crawled the content.

I hardly believe his words now after his miscommunication on topical authority, when he said Google does not care what a site is publishing regardless of the niche match and content quality, if you guys remember. Now I am not an SEO guru or someone who has hacked all the algorithms of Google, I am part of a mid level SEO service website team, but what I feel is straight to you readers.

BUT BUT. If your content is worthy of sharing and you are confident that people mostly share your URLs, then you need optimized, organized URLs. So:

1. Keep URL Slugs Short but Meaningful

I prefer URLs that communicate the page topic without unnecessary words.

  • Less useful: /blog/how-to-find-the-best-seo-tools-for-your-website

  • Cleaner: /blog/best-seo-tools

Tell me your answer: you might say the shorter version is easier to read and share. But if you see it from the machine or the human point of view, who cares, it will be eventually forwarded, right?

The worry would be when you have created something very long, now I will show you that as well:

See this example URL, do you see the core title or the argument of the URL is about the American Museum of Natural History - Roberto Mignone Halls of Gems and Minerals, so do yourself a practice here, what would you create?

Or let me give you this one:

Little Women Ballet Autumn Immersive At Heritage Square Museum, October 2 To 4, 2026

This is an example title my client wanted to publish, right, so what should be the best slug, let me know via email at [email protected], I will review your suggestions.

However, Google doesn't require a specific slug length. Clarity matters more than hitting an arbitrary character count.

2. Use Hyphens Instead of Underscores

Google recommends hyphens to separate words in URLs.

  • /seo_audit_checklist becomes /seo-audit-checklist

  • /bestseotools becomes /best-seo-tools

  • /local_seo_guide becomes /local-seo-guide

This is the best practice but it never meant you are not allowed to use them, those sites who publish in Hindi, have you ever seen their slugs in Chrome, try giving it a check today, if you are on WordPress publish this as the slug:

दुनिया की सबसे अच्छी वेबसाइट कौन सी है?

Then see the Chrome magic when you copy it or share it.

Now coming back to hyphens, Google's page suggests us hyphens, not underscores. Wikipedia uses underscores in every single URL it has ever published and sits on page 1 of half the internet. So simply, if I am doing SEO for Wikipedia, for the established URLs I wouldn't go for redirects just to replace the underscores unless there is a broader reason to restructure them.

3. Remove Unnecessary Words

Not a ranking tip, but helpful if you are publishing or optimizing new slugs.

Words like "the," "a," and "of" aren't automatically bad. I remove them only when the slug remains clear.

For example: /guide-to-the-best-email-marketing-tools

Could become: /best-email-marketing-tools

But I wouldn't remove words that change the meaning of the topic.

4. Keep URL Casing Consistent

Lowercase slugs, the only nail in the coffin needed, no ifs and buts on this, because this is the culture and the habit. Like when we search URLs ourselves, do we ever uppercase the URLs??

For example: example.com/blog/seo-guide rather than example.com/Blog/SEO-guide.

URL paths can be case-sensitive depending on the server, and even if it does, it's its fault, because I will show you an old website that still does this.

You must be acquainted with this one:

OK, leave Wikipedia, they are violating the Google guidelines, OK, leave them. What about Google's girlfriend:

They not only use capital words but also the underscore, plus multiple variations of it. OK, leave Reddit:

Now it's YouTube here, and they index these URLs and rank them as well. So putting them here is not to suggest you create weird URLs like YouTube, you are not a Google family member like YouTube is, but it's the infra, that if your site is using the ASP.NET framework or any other whose URLs are previously carrying these variations, even if you ignore it, that is not a problem, this is what the logic here is. And create the new URLs according to the above ideas.

Remember one thing:

Inconsistent casing may create multiple address variations. Even duplicate URLs and indexing (duplication in my view is the death for the site), and 404s as well. Here you go:

500 - Internal server error.

https://artdaily.com/news/199705/Pre-Look-Into-Noodle-Magazine-s-September-Launch-And-The-Idea-Behind-It-Starts-With-August

Because of the slugs.

And if I lowercase it:

Feel the loop, both URLs are creating a new page and can be indexed separately, like OK I lowercased it, but my Apache or Nginx settings should have been set so that it reverts it back quickly and updates the URL in the browser, right?

5. Review Your URL Before Publishing

Before publishing, I check whether the slug is readable, descriptive, and free from unnecessary complexity.

A simple URL Analyzer can help you review URL structure and identify formatting concerns worth checking.

However, a URL structure checker doesn't replace Google Search Console or a technical crawler for checking indexing and redirects.

Managing the Slugs Without Losing the Page Rankings

Now coming to the idea of the existing fixes.

June 2021 hangout, Mueller said Google can forward ranking signals without a 301 redirect, it spots the moved content and picks a canonical between the 2 URLs on its own.

I don't believe this, the 301 is needed even if Google picks it, you still need it, if you are being linked from somewhere you must get that credit to your landing page instead of a white cartoon page, or someone else may otherwise buy it. The expired domain industry is a multi million $ market even today.

And Google and the SEO guidelines recommend keeping your 301 redirects active for at least 12 months (1 year), and ideally permanently, because dropping them too early can cause traffic drops, now this is about let's say you are moving from .co.uk to .com, that is the case right, not the exact URL.

And one major concern is the internal URLs, yes yes this is the major one that I even have missed in one of my projects, we internal link the URLs, right??

Now Moving the URLs

As I said earlier, the overnight developer case, you were on WordPress yesterday and after a week with Claude Code you have moved the whole site to NEXT or ASTRO, so the URLs are moving with it, right.

Or like earlier you were using Shopify and now you use WordPress, or you moved to a custom framework, I suggest going with the same collection for the primary indexed and ranked URLs (if the URLs are not ranking and that is the reason you moved out, then the experiment is worth a try), but still we will be 301 redirecting, right?

Now the simple thing, if you are moving to WordPress, with the help of Claude create a simple PHP based plugin, export the previous sitemap, and if you are not keeping the URLs the same apply the 301 redirects, just give a prompt to Claude and it will create it. Copy this prompt as it is:

Create a WordPress plugin in a single PHP file. It should let me upload or paste my old site's sitemap.xml, read all the old URLs out of it, and show me a field next to each old URL where I enter the new URL on this site. Save the old-to-new pairs in the database and 301 redirect every old URL to its mapped new URL. Add a small admin page under Tools to manage the list, and log any old URL that gets visited but has no new URL assigned yet, so I can fix it.

Or if it's a handful of limited URLs, use the .htaccess file and quick redirect it, an example:

And if you are going to a custom framework, remember not to miss it.

Step 1: Start by a Simple Record of the Existing URL's Performance

Before making changes, I check:

  • Organic clicks and impressions in Google Search Console.

  • Current keyword rankings. Use the Ahrefs free project, add your site as a project, run the crawler and export the report.

  • Backlinks pointing to the page.

  • Internal links referencing the URL (reminding you again, that is why the 301 is very important, because now after changing the slugs if you don't care you have the headache of broken URLs going from the new pages which is a direct slap to your SEO feelings).

  • The existing canonical URL, an important one, see your Gmail box how many Google Search Console emails are crying about this, so this is also the reason.

  • Update the sameAs and OG tags as well if you are on a manual CMS.

This gives me a baseline for measuring the change.

Step 2: Create an Old-to-New URL Map

I document exactly where each old URL should lead.

Old URLNew URL
/blog/seo_tips/blog/seo-tips
/guide-2023/updated-guide
/category/marketing/tools/marketing-tools

Every changed URL should have a relevant destination.

Avoid redirecting unrelated pages to your homepage. Instead of redirecting to the homepage, if the changes are new keep them open as a regular 404 on the same slug, like instead of redirecting them to a 404 page show the 404 on the same slug but the page title should show 404, so at least you can track it from Google Analytics, and this is the major point that I am giving you guys and it is personal experience and mistakes.

Now why do I say this, because of the reasons I mentioned above, it's that simple, I won't make any fuss or warnings of what will happen and what not.

Step 3: Update Your XML Sitemap

Remove the outdated addresses from your current XML sitemap and include the new canonical URLs. Don't forget to edit the sitemaps, yeah in WordPress and Shopify they are auto but if PHP or another custom framework, ensure this please.

Step 4: Avoid the Overnight Change

If you are handling a major big site, don't do all the 1000s of URLs in one night, go phase by phase and monitor, because there are tons of case studies and sites whose spinal cord never got into the same position after doing this overnight change.

Also avoid mass changes without a clear reason and a tested migration plan.

Quick Test

Let's say you migrate 100 articles from an existing blog to a new site. What do you do with the 'Date Published' of the migrated articles on the new site?

  • Keep the former dates.

  • Update to the date migrated.

  • Stagger the dates on the new blog.

Share

Last updated .