Skip to Content

URLs with uppercase letters, underscores or spaces

What Is This Issue

This issue checks whether your URLs follow clean formatting conventions using lowercase letters and hyphens between words.

For a URL to pass this check:

  • All letters in the URL path should be lowercase (e.g., /blog/post not /Blog/Post)
  • Word separators should use hyphens (e.g., /my-page not /my_page or /my page)
  • The URL should not contain encoded spaces or mixed separators

Example: A URL like https://example.com/Blog/My_Post would fail because it has uppercase letters and underscores. The preferred format would be https://example.com/blog/my-post.

Why Is This Important

Clean URL structure is important for:

  • Crawlability: Consistent URLs prevent search engines from treating the same page as multiple different pages
  • Duplicate content: Mixed casing and separators can create duplicate URL variants that split ranking signals
  • User experience: Clean, readable URLs are easier for users to understand and share

When URLs don’t follow consistent formatting, search engines may:

  • Index multiple versions of the same page
  • Split link equity across different URL variants
  • Have difficulty understanding your site structure

Resolving this issue improves your SEO health score by ensuring search engines see a single, consistent version of each URL.

How XeoPix Detects This

XeoPix checks URL structure through these steps:

  1. Analyzes the final URL: After following any redirects, XeoPix examines the final URL path (the part after the domain name).

  2. Checks for lowercase: The system verifies that all letters in the path are lowercase.

  3. Checks separators: XeoPix looks for hyphens between words rather than underscores, spaces, or other separators.

  4. Identifies violations: The system flags URLs that have:

    • Uppercase letters in the path
    • Underscores or encoded spaces instead of hyphens
    • Mixed or inconsistent separator styles
  5. Reports issues: XeoPix provides a list of URLs with formatting violations and suggests the corrected format.

The check is performed on the server-returned URL only—no client-side routing is considered.

How To Fix

  1. Adopt a URL policy: Decide on a standard format (lowercase + hyphens) and apply it consistently across your entire site.

  2. Update your CMS or framework: Configure your content management system or web framework to automatically generate URLs in the correct format.

  3. Set up redirects: Create permanent (301) redirects from old URL formats to the new clean format.

  4. Update internal links: Ensure all internal links point to the clean URL format.

  5. Update sitemaps: Make sure your XML sitemaps only include the clean URL versions.

  6. Validate with crawling: Run a site crawl to identify any remaining URLs that don’t follow the clean format.

What We Store

Storage Level

Page Level


Database Table / Prisma Model

Urls


Stored Fields

FieldTypeDescription
urlstringThe URL being analyzed
crawlDepthInt?The crawl depth of the URL

Detection Dependencies

  • HTML Document
  • URL Structure

Examples

Example 1: Clean URL structure

Scenario: A blog post with properly formatted URL.

Passes because:

  • All letters are lowercase
  • Words are separated with hyphens
  • No encoded spaces or special characters
https://example.com/blog/seo-tips-for-beginners

Example 2: URL with uppercase letters

Scenario: A URL with inconsistent capitalization.

Fails because:

  • Contains uppercase letters in the path
  • Search engines may treat /Blog/Post and /blog/post as different pages
https://example.com/Blog/My-Post

Corrected version:

https://example.com/blog/my-post

Example 3: URL with underscores

Scenario: A URL using underscores instead of hyphens.

Fails because:

  • Uses underscores as word separators
  • Hyphens are the preferred separator for SEO
https://example.com/blog/my_post_title

Corrected version:

https://example.com/blog/my-post-title

Unit Test

Test File

xeopix-crawling-v2/__tests__/seo-audit-checks/crawlBehaviour/issue-15-structure-clean-lowercase.test.js

Purpose

This unit test validates that the checkStructureCleanLowercase() function correctly detects URL path issues such as uppercase letters, underscores, and encoded spaces, ensuring URLs follow clean lowercase hyphenated conventions.

Tested Function

checkStructureCleanLowercase() from seo-audit-checks.js

Issue Information

  • Issue Number: 15
  • Issue Code: STRUCTURE_CLEAN_LOWERCASE
  • Toggle Group: crawlBehaviour

Test Scenarios

Positive Test Cases

  • URL path is already lowercase and hyphenated (/about-us) → no invalid URLs, no issues

Negative Test Cases

  • URL path contains uppercase letters and underscores (/About_US) → STRUCTURE_CLEAN_LOWERCASE issue created with reasons 'URL path contains uppercase letters' and 'URL path uses underscores (_) instead of hyphens (-)'

Boundary Cases

None

Edge Cases

  • URL with encoded spaces (/products%20page) → detected as invalid with reason 'URL path contains spaces instead of hyphens (-)'

Expected Outcome

Pass

A STRUCTURE_CLEAN_LOWERCASE issue is not reported when the URL path is already lowercase and uses hyphens as word separators.

Fail

A STRUCTURE_CLEAN_LOWERCASE issue is reported when:

  • The URL path contains uppercase letters
  • The URL path uses underscores (_) instead of hyphens (-)
  • The URL path contains encoded spaces

Validation

  • Verifies detection of lowercase violations
  • Validates underscore detection with appropriate reason
  • Checks encoded space detection
  • Validates payload structure (invalidUrls, reasons, issueCode)
  • xeopix-crawling-v2/seo-audit-checks.js
  • xeopix-crawling-v2/issueCodes.js

Coverage Summary

  • 3 test cases (positive, negative, and edge case)
  • Covers uppercase, underscore, and encoded space detection
  • Validates multiple reasons per URL in the negative case
  • Includes API mocking for URL ID resolution

References

Last updated on