meta warning meta/canonical

Canonical URL SEO Rule

Ensure every page has a valid canonical URL to prevent duplicate content issues and consolidate link equity

What This Rule Checks

Validates the presence and correctness of rel=canonical links. Checks for absolute URLs, HTTPS protocol, non-localhost domains, multiple canonicals, and conflicts with noindex directives.

Why It Matters for SEO & GEO

Canonical URLs tell search engines which version of a page is the primary one. Without proper canonicalization, duplicate content can dilute rankings and waste crawl budget.

How to Fix

Add a self-referencing canonical URL to every page using an absolute HTTPS URL. Ensure only one canonical tag exists per page. Remove conflicting noindex directives when using canonicals.

Examples

Bad

<link rel="canonical" href="/about">

Good

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

How VibeLinter Checks Canonical URLs

VibeLinter’s meta/canonical rule performs these checks on every page:

  1. Existence — Reports an info-level issue when no canonical URL is found
  2. Multiple canonicals — Flags multiple <link rel="canonical"> tags as a warning
  3. Empty href — Reports canonical tags missing the href attribute
  4. Absolute URL — Ensures the canonical URL is absolute, not relative
  5. HTTPS protocol — Flags canonical URLs using HTTP instead of HTTPS
  6. Non-localhost — Catches canonical URLs pointing to localhost or 127.0.0.1
  7. Self-referencing check — Notes when canonical points to a different page
  8. Noindex conflict — Errors when both noindex and canonical directives exist (conflicting signals)

Configuration

// vibelinter.config.cjs
module.exports = {
  rules: {
    'meta/canonical': {
      enabled: true,
      severity: 'warning'
    }
  }
}

SEO Impact

Proper canonical URL implementation affects:

  • Duplicate content resolution — Tells search engines which page version to index
  • Link equity consolidation — Combines ranking signals from duplicate pages
  • Crawl budget optimization — Prevents search engines from crawling duplicate pages
  • GEO (Generative Engine Optimization) — AI models rely on canonical URLs to determine the authoritative version of content, ensuring the correct page is cited in generated answers

Related SEO Topics

canonical URL SEOrel canonical tagduplicate content preventioncanonical link elementURL canonicalizationlink equity consolidation

Related Rules

References