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:
- Uses Eleventy’s built-in
page.urlvariable for the correct path - Converts
/index.htmlto/for the homepage - Keeps
.htmlextensions for all other pages (matching existing URL structure) - 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)
- Before:
canonical: https://sempers.com(was already absolute, but inconsistent format) - After:
<link href="https://sempers.com/" rel="canonical"/>
Blog page
- Before:
<link href="../blog/blog.html" rel="canonical"/> - After:
<link href="https://sempers.com/blog/blog.html" rel="canonical"/>
Nested page (age-discrimination)
- Before:
<link href="../age-discrimination/suing-for-age-discrimination-in-california.html" rel="canonical"/> - After:
<link href="https://sempers.com/age-discrimination/suing-for-age-discrimination-in-california.html" rel="canonical"/>
Root-level page
- Before:
<link href="harassment-at-work-what-to-do.html" rel="canonical"/> - After:
<link href="https://sempers.com/harassment-at-work-what-to-do.html" rel="canonical"/>
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:
- No manual updates needed for new pages
- Single point of change if domain changes
- Guaranteed consistency across all pages
Deployment Status
- Git push: Successful (master branch)
- Production deployment: COMPLETED SUCCESSFULLY
- Workflow run ID: 21348900737
- All regression tests: PASSED
Verification
After deployment, you can verify the fix by viewing page source on any page:
- Visit https://sempers.com/blog/blog.html
- View page source (Ctrl+U / Cmd+Option+U)
- Search for
rel="canonical" - Confirm URL is
https://sempers.com/blog/blog.html(absolute, not relative)
Expected Impact
Google Search Console should:
- Stop reporting “Duplicate, Google chose different canonical than user” errors
- Index pages with the correct user-specified canonical URL
- 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:
business-files/DUPLICATE_CANONICAL_INVESTIGATION.mdbusiness-files/STATUS_OF_INDEXING_REPAIR.md