Skip to main content

Canonical tags are self-referencing and consistent

ab-001684 · marketing-advanced-seo.technical-seo.canonical-consistency
Severity: criticalactive

Why it matters

A canonical pointing to HTTP while the site serves HTTPS tells Google to index the insecure URL — which may not exist — and the page drops out of results. Conflicting canonical declarations (one in the layout, one in the page) force Google to pick arbitrarily, often choosing the wrong target. Cross-domain canonicals caused by copy-paste errors hand your ranking authority to the wrong host entirely.

Severity rationale

Critical because a malformed canonical can deindex the correct URL or transfer authority to a wrong destination sitewide.

Remediation

Generate canonicals from a single source of truth such as NEXT_PUBLIC_SITE_URL so every page emits absolute HTTPS URLs. Remove any canonical declaration from layouts when pages also set one — keep it in exactly one place per route. Strip tracking and session parameters from the canonical value before rendering it.

// app/layout.tsx
export const metadata = { alternates: { canonical: `${process.env.NEXT_PUBLIC_SITE_URL}/current-page` } }

Detection

  • ID: marketing-advanced-seo.technical-seo.canonical-consistency

  • Severity: critical

  • What to look for: Count all canonical tags across the site. Enumerate which are self-referencing (correct) vs. which point elsewhere or are missing. Examine all pages that have canonical URL configuration. Check for these failure patterns: (1) canonical tags that point to a different domain than the current site (possible copy-paste error), (2) canonical tags that use HTTP when the site serves HTTPS, (3) pages with multiple conflicting canonical declarations (e.g., one in the layout metadata and one in the page metadata with different values), (4) canonical URLs that include unnecessary query parameters (tracking params, session IDs), (5) circular canonicalization (page A canonicals to page B, which canonicals back to page A).

  • Pass criteria: All canonical URLs are absolute HTTPS URLs, self-referencing (pointing to the correct preferred version of the current page), free of session/tracking parameters, and not in conflict with other canonical declarations. 100% of indexable pages must have self-referencing canonical tags.

  • Fail criteria: Any canonical tag uses HTTP instead of HTTPS. Any canonical points outside the site's primary domain without a valid redirect explanation. Any page has multiple conflicting canonical declarations.

  • Skip (N/A) when: No canonical tags exist in the project (absence is caught by a separate check; this check validates correctness of existing canonicals only).

  • Do NOT pass when: Canonical tags exist but use relative URLs instead of absolute URLs, or mix HTTP and HTTPS schemes.

  • Cross-reference: For duplicate content handling strategy, see duplicate-content-handling.

  • Detail on fail: "Canonical inconsistency: canonical tags on /blog use HTTP instead of HTTPS. Two conflicting canonical declarations found on /products — one in layout metadata and one in page metadata with different values."

  • Remediation: A malformed canonical is often worse than no canonical — it can actively direct search engines to index the wrong URL or split link equity. Always use absolute HTTPS URLs for canonicals. Generate canonical URLs from a single source of truth such as your NEXT_PUBLIC_SITE_URL environment variable, so that all pages consistently use the same scheme and domain.

    // app/layout.tsx — ensure self-referencing canonicals
    export const metadata = { alternates: { canonical: 'https://yoursite.com/current-page' } }
    

Taxons

History