Home / Fix guides / On-page SEO

How to fix long or messy URLs on your website

Shorten the page address (the slug) to a few readable words, remove IDs, dates and junk, then set up a 301 redirect from the old address to the new one. Do not change a URL without a redirect, or you can lose the visitors and search rankings the old address had.

A URL is the web address of a page. A messy one looks like example.com/index.php?id=4821&cat=17&sessionid=a8f3k2 or example.com/blog/2021/03/15/our-top-ten-tips-for-choosing-the-best-possible-garden-furniture-for-your-home-this-summer. A clean one looks like example.com/garden-furniture-guide.

There is no official limit that makes a long URL "wrong". Browsers and search engines handle very long addresses. The problem is that long and messy addresses are harder for people to read, trust, share and remember, and they often point to deeper structural problems on the site.

What people see

  • Addresses full of numbers, codes or symbols such as ?, &, %20 and =
  • Slugs that repeat the full page title, including filler words
  • Several folder levels for no reason, such as /shop/category/subcategory/type/product
  • Dates in the address of articles that never go out of date
  • Links that wrap onto three lines in an email or get cut off in a social post

Why it matters

Search. Search engines use the words in a URL as a small hint about the page topic, and they show the address (or a trimmed version of it) in results. Descriptive, short addresses are easier to understand. Messy addresses, especially ones with parameters, can also create many versions of the same page, which splits your signals. See URL parameters and session IDs for that side of the problem.

Trust and sales. People look at an address before they click, particularly in email and chat. example.com/garden-furniture-guide looks safer than a string of codes. Short addresses are also easier to say out loud, print on a flyer or put on a van.

Maintenance. Addresses with dates or IDs in them tend to break when you reorganise the site, and they make reports and analytics harder to read.

How to check if your site has it

You can do all of this for free.

  1. Look at your own pages. Click through your main menu, a few blog posts and a few products. Note anything with numbers, question marks or very long slugs.
  2. Use Google Search Console. If your site is verified, the Pages report and the Performance report (Pages tab) list the addresses Google knows about. Sort or scan for long ones and ones containing ?.
  3. Search Google for your site. Type site:yourdomain.com and read the addresses in the results.
  4. Crawl the site. The free version of Screaming Frog SEO Spider can crawl a limited number of pages and lets you filter URLs by length and by those containing parameters. Check its current free limit before you start.
  5. Check your sitemap. Open yourdomain.com/sitemap.xml (the exact location varies) and scan the list.

A useful rule of thumb is to keep slugs to a handful of meaningful words. That is a guideline, not a rule. A long address that is clear and stable is better than a short one that is cryptic.

How to fix it in general

The safe order matters more than the exact tool.

  1. Decide which pages are worth changing. Start with important pages: home, services, top products, your best blog posts. Leave old low-value pages alone unless they are truly broken.
  2. Write the new slug. Use lowercase words separated by hyphens. Drop filler words ("the", "for", "your"), dates, IDs and categories you do not need. Keep the main topic word.
  3. Keep a list. Write the old address and the new address side by side in a spreadsheet.
  4. Change the slug. This is the part that differs by platform (see below).
  5. Add a 301 redirect from every old address to its new one. A 301 tells browsers and search engines the move is permanent, so visitors and ranking signals follow along.
  6. Update internal links. Fix links in menus, buttons, posts and your sitemap so they point straight to the new address instead of going through a redirect.
  7. Set a canonical tag if more than one address can still show the same page. Most platforms and SEO plugins add this for you.

Never change many addresses in one go without redirects. Do it in small batches so you can spot problems.

Common platforms

Menu names change between versions and themes, so treat these as pointers.

  • WordPress: the site-wide structure is usually under Settings then Permalinks. Post name is the usual clean choice. Individual slugs are edited in the post or page editor under the URL or permalink setting. Do not rely on WordPress to redirect everything after a structure change, and use a redirect tool or plugin such as Redirection or the redirect feature in Yoast SEO Premium or Rank Math. More detail in the WordPress guide.
  • WooCommerce: product and category prefixes are usually under Settings then Permalinks, in the product base and category base fields.
  • Shopify: edit the URL handle at the bottom of a product, page or collection in the search engine listing section. Shopify normally offers a checkbox to create a redirect when you change it. The /products/ and /collections/ parts are fixed. See the Shopify guide.
  • Wix: open the page settings, find the SEO or URL slug field, and edit it. Wix often offers to set up the redirect for you.
  • Magento: edit the URL Key in the Search Engine Optimization section of the product or category, and tick the option to create a permanent redirect for the old URL.
  • Joomla: check that search engine friendly URLs and URL rewriting are on in Global Configuration, then edit each item's alias.
  • Drupal: the Pathauto module sets address patterns, and the Redirect module handles old addresses.

If your site has no page editor for addresses (a custom build), your developer will change them in the code or server settings.

How to confirm the fix worked

  • Visit an old address. It should land on the new one without an error page.
  • Use a free redirect checker, or your browser's developer tools (Network tab), to confirm the old address returns a 301 and the new address returns 200.
  • Click through your menus and check there are no redirect chains (old to old to new).
  • Submit your updated sitemap in Google Search Console and use URL Inspection on a few key pages.
  • Over the following weeks, watch the Pages report for new "not found" errors and fix any redirects you missed.

SiteMonday's week 1 SEO review (/week/1/) flags long and messy addresses as part of its written report and ranked fix list. It finds and explains them, and you or your developer make the changes.

How to stop it coming back

  • Set the site-wide address structure once and leave it alone.
  • Write the slug yourself before you publish. Many editors generate it from the full title, so trim it.
  • Avoid dates and category names in addresses unless there is a real reason.
  • Turn off or control tracking parameters and session IDs that add junk to links.
  • Keep a short house rule for your team: lowercase, hyphens, three to five meaningful words.
  • Keep your redirect list. Do not delete old redirects casually, because old links in emails and other sites still use them.

Step by step for your platform

Questions

How long should a URL be?

There is no official limit. A common rule of thumb is a few meaningful words in the slug, with no IDs, dates or filler. Clarity matters more than a specific character count.

Will changing my URLs hurt my rankings?

It can if you skip redirects. With a 301 redirect from each old address to its new one, and updated internal links, most of the value normally carries over, though rankings can fluctuate briefly.

Should I change old URLs that already rank well?

Be careful. If an old address is performing and only slightly long, leaving it is often safer. Fix messy ones first, and always redirect.

Do stop words like 'the' and 'and' need to be in the URL?

No. You can usually drop them without losing meaning, which keeps the address shorter and cleaner.

What is the difference between a slug and a URL?

The URL is the full address. The slug is the last part that names the page, such as `garden-furniture-guide`, and it is the part you normally edit.

Do I need a developer to fix this?

Not always. On most platforms you can edit slugs and add redirects yourself. A developer helps for custom sites, large catalogues or server level redirect rules.

Related problems