URL Structure Best Practices for Ecommerce
What a Good Ecommerce URL Looks Like
The ideal ecommerce URL is short, descriptive, includes relevant keywords, and reflects the site hierarchy. Here are examples of good URL structures for different page types:
- Homepage: yourdomain.com
- Category: yourdomain.com/mens-running-shoes/
- Subcategory: yourdomain.com/mens-running-shoes/trail/
- Product: yourdomain.com/mens-running-shoes/brooks-ghost-16
- Blog post: yourdomain.com/blog/how-to-choose-running-shoes
Compare those with poor URL structures that many stores use by default:
- yourdomain.com/collections/mens-running-shoes-collection-1
- yourdomain.com/products/product-847
- yourdomain.com/catalog.php?cat=12&subcat=3&product=847&ref=nav
- yourdomain.com/collections/all?filter=category%3Amens-running-shoes&sort=best-selling
The good examples are readable by humans and search engines alike. They include keywords (mens-running-shoes, brooks-ghost-16), show the site hierarchy through folder structure, and contain no unnecessary parameters or ID numbers.
Key Principles for Ecommerce URLs
Use Hyphens Between Words
Google treats hyphens as word separators: "mens-running-shoes" is read as three separate words. Underscores, spaces (encoded as %20), and camelCase are not treated the same way. Always use lowercase letters with hyphens between words in your URL slugs.
Keep URLs Short and Focused
Include the primary keyword and essential descriptors, but remove filler words. "yourdomain.com/mens-running-shoes/brooks-ghost-16" is better than "yourdomain.com/shop/collections/mens-running-shoes-and-athletic-footwear/all-products/the-brooks-ghost-16-running-shoe." Every unnecessary word dilutes the keyword signal and makes the URL harder to read, remember, and share.
Include Keywords Naturally
Your target keyword should appear in the URL for each page: the category keyword in category URLs, the product name in product URLs, and the article topic in blog URLs. This provides a small but consistent ranking benefit and helps users understand what they will find before clicking. Do not stuff multiple keywords into a URL; one focused keyword or phrase is sufficient.
Reflect Site Hierarchy
URLs should mirror your site's navigation structure. If a product belongs to the "Trail Running Shoes" category, its URL should include that category path: /trail-running-shoes/salomon-speedcross-6. This hierarchy reinforces the parent-child relationship between categories and products for both users and search engines. It also enables breadcrumb display in search results when paired with BreadcrumbList schema.
Avoid Dynamic Parameters When Possible
URLs with query parameters (?sort=price&color=blue&page=3) create duplicate content issues and look untrustworthy to users. Configure your platform to use clean, static URLs for all important pages. When parameters are necessary for filtering and sorting, handle them with canonical tags or noindex directives as described in the duplicate content guide.
Platform-Specific URL Configuration
Shopify: Shopify forces a specific URL structure that cannot be fully customized. Collections use /collections/collection-handle, products use /products/product-handle, and pages use /pages/page-handle. You can customize the handle (slug) for each item but cannot remove the /collections/ or /products/ prefix. This structure works fine for SEO, but be aware that product pages may also be accessible at /collections/collection-name/products/product-handle, which creates duplicate URLs. Shopify handles this with canonical tags by default, but verify they are working correctly.
WooCommerce: WordPress offers full URL customization through Settings > Permalinks. Set your product permalink structure to include the category: /%product_cat%/%postname%/. This creates URLs like /running-shoes/brooks-ghost-16/ that show hierarchy and include keywords. Set your blog permalink to /blog/%postname%/ to keep blog content organized separately from product pages.
Custom platforms: Configure your URL routing to produce clean, descriptive URLs. Use URL rewriting (mod_rewrite on Apache, try_files on Nginx) to map clean URLs to your internal page identifiers. Ensure every product URL includes the product name and optionally the category name, with no visible query parameters.
Handling URL Changes Safely
Changing existing URLs is risky because it breaks external links, drops current rankings temporarily, and can cause 404 errors if redirects are not set up correctly. Avoid changing URLs unless the benefits clearly outweigh the risks. Valid reasons to change URLs include moving from parameterized to clean URLs, reorganizing your category structure, and rebranding.
When you must change URLs, follow this process:
- Map every old URL to its new URL in a spreadsheet before making any changes.
- Set up 301 redirects from every old URL to its new URL. A 301 redirect tells Google and browsers that the page has permanently moved and transfers the majority of link equity to the new URL.
- Update your internal links to point to the new URLs. Do not rely on redirects for internal navigation because each redirect adds latency.
- Update your XML sitemap to include the new URLs and remove the old ones.
- Monitor Search Console for crawl errors and indexing issues in the weeks following the change.
Expect a temporary ranking dip of 1 to 4 weeks after URL changes, even with proper 301 redirects. Rankings typically recover to their previous levels once Google reprocesses the redirects and re-evaluates the new URLs. Do not make URL changes during your peak selling season.
Common URL Mistakes to Avoid
- Using product IDs instead of names: /products/847 tells nobody what the page is about. Use /products/brooks-ghost-16 instead.
- Creating excessively deep URLs: /shop/collections/mens/footwear/running/trail/waterproof/salomon-speedcross creates unnecessary depth. Two to three folder levels is ideal.
- Allowing multiple URLs for the same page: Ensure each page is accessible at one canonical URL. Use redirects or canonical tags for all variants.
- Including session IDs or tracking parameters in indexed URLs: Block these with robots.txt or canonical tags so Google does not index thousands of duplicate parameterized URLs.
- Using uppercase letters: Some servers treat /Products/ and /products/ as different URLs, creating duplicates. Use lowercase exclusively.
- Changing URLs without redirects: Every URL change without a 301 redirect creates a broken link and loses accumulated ranking authority.
