Archived document. This file has been superseded or completed and is kept for historical reference.

Canonical Tags Fix Report

Date: January 26, 2026 Status: Deployed to Production Commit: 1aa450e

Summary

Fixed all canonical URL tags across the sempers.com website, converting relative URLs to absolute URLs to resolve Google Search Console indexing issues.

Problem

Approximately 95% of pages had relative canonical tags like:

<link href="../blog/blog.html" rel="canonical"/>

This caused Google Search Console to report “Duplicate, Google chose different canonical than user” because relative URLs are ambiguous and may resolve differently depending on the base URL context.

Solution

Modified the Eleventy template (src/_includes/head.njk) to automatically generate absolute canonical URLs using the page’s URL variable:

Before (template):

{% if canonical %}<link href="{{ canonical }}" rel="canonical"/>{% endif %}

After (template):

<link href="https://sempers.com{{ page.url | replace('/index.html', '/') }}" rel="canonical"/>

This approach:

  1. Uses Eleventy’s built-in page.url variable for the correct path
  2. Converts /index.html to / for the homepage
  3. Keeps .html extensions for all other pages (matching existing URL structure)
  4. Removes the need for per-page canonical settings in front matter

Files Changed

Category Count Notes
Source files 1 src/_includes/head.njk
HTML output files 120 All pages in public_html/
Total pages with canonical tags 122 All content pages now have absolute canonicals

Before/After Examples

Homepage (index.html)

Blog page

Nested page (age-discrimination)

Root-level page

Pattern Used

Template-based fix - A single change to src/_includes/head.njk automatically generates correct canonical URLs for all pages based on their output path.

This is more maintainable than updating each individual page’s front matter because:

  1. No manual updates needed for new pages
  2. Single point of change if domain changes
  3. Guaranteed consistency across all pages

Deployment Status

Verification

After deployment, you can verify the fix by viewing page source on any page:

  1. Visit https://sempers.com/blog/blog.html
  2. View page source (Ctrl+U / Cmd+Option+U)
  3. Search for rel="canonical"
  4. Confirm URL is https://sempers.com/blog/blog.html (absolute, not relative)

Expected Impact

Google Search Console should:

  1. Stop reporting “Duplicate, Google chose different canonical than user” errors
  2. Index pages with the correct user-specified canonical URL
  3. Consolidate ranking signals to the intended canonical URLs

Note: It may take several days to weeks for Google to recrawl and reindex all pages.

Related Issues

This fix addresses the canonical URL component of the indexing issues documented in: