Skip to content
Browse all guides

Issue #6 · critical

Issue 6

What is this issue?

This issue checks whether every crawlable HTML page includes exactly one valid canonical link element in the head section.

A canonical tag tells search engines which URL should be treated as the "official" version of a page when multiple URLs show similar or identical content. For this check to pass:

  • The page must have exactly one canonical tag
  • The canonical URL must be valid and parseable
  • The canonical tag must be properly placed in the HTML head section

Example: If your page is accessible at both https://example.com/page and https://example.com/page?utm_source=newsletter, a canonical tag pointing to https://example.com/page tells search engines to consolidate ranking signals to that preferred URL.

Why does it matter?

Canonical tags are essential for:

  • Indexability: They help search engines understand which URL should appear in search results
  • Rankings: Canonicalization consolidates ranking signals (like links and engagement) to a single preferred URL
  • Duplicate content: They prevent multiple URL variants from competing with each other in search results

When canonical tags are missing, duplicated, or malformed, search engines may:

  • Choose an unintended URL as the canonical version
  • Split ranking signals across multiple URL variants
  • Create reporting inconsistencies in analytics and search console data

Resolving this issue improves your overall SEO health score by ensuring search engines can reliably identify and rank your preferred URLs.

How to fix it

  1. Add a canonical tag to every indexable page: Ensure each HTML page includes one <link rel="canonical" href="..."> tag in the head section.

  2. Use absolute URLs: Always use complete URLs (e.g., https://example.com/page) rather than relative paths.

  3. Ensure uniqueness: Each page should have exactly one canonical tag—not zero, not multiple.

  4. Make URLs valid: The canonical URL should be a properly formatted, parseable absolute URL.

  5. Validate implementation: After deployment, crawl your pages to confirm canonical tags are present, unique, and point to valid URLs.

  6. Keep it deterministic: Configure your templates or CMS to generate canonical tags consistently so exactly one tag appears per page.

Examples

Example 1: Correct canonical tag

Scenario: A page with a properly implemented canonical tag.

Passes because:

  • Exactly one canonical tag is present
  • The canonical URL is a valid absolute URL
  • The tag is placed in the HTML head section
<head>
  <link rel="canonical" href="https://example.com/blog/post" />
</head>

Example 2: Missing canonical tag

Scenario: A page without any canonical tag.

Fails because:

  • No canonical tag is present
  • Search engines must guess the preferred URL
  • Multiple URL variants may be indexed
<head>
  <!-- No canonical tag -->
</head>

Corrected version:

<head>
  <link rel="canonical" href="https://example.com/blog/post" />
</head>

Example 3: Multiple canonical tags

Scenario: A page with multiple canonical tags.

Fails because:

  • Multiple canonical tags create confusion
  • Search engines may not know which URL is preferred
  • This is invalid HTML
<head>
  <link rel="canonical" href="https://example.com/page1" />
  <link rel="canonical" href="https://example.com/page2" />
</head>

Corrected version:

<head>
  <link rel="canonical" href="https://example.com/page1" />
</head>

How PixyScan detects this

PixyScan follows these steps to identify canonical tag issues:

  1. Fetches the page: PixyScan requests the URL and checks if the response is HTML content.

  2. Extracts canonical tags: It parses the raw HTML and looks for all <link> elements in the head section where the rel attribute contains "canonical".

  3. Counts and validates: PixyScan counts how many canonical tags are found and extracts the href values.

  4. Checks for issues: The system flags problems when:

    • No canonical tag is found
    • Multiple canonical tags are present
    • The canonical URL is empty or malformed
    • The canonical URL cannot be parsed as a valid absolute URL
  5. Reports findings: PixyScan records whether the page passes or fails the canonical check, along with details about what was found.

The detection relies only on the raw HTML response—no JavaScript execution or browser rendering is used.

References