---
name: canonical-tags
description: Audit and fix rel=canonical tags and duplicate URLs so search engines index one URL per page. Use when Search Console shows duplicate or "Alternate page" issues, or when the same content is on several URLs.
---

# Canonical tags

## Facts to use
- Signals that help Google pick a canonical, strongest first: redirects, `rel="canonical"` link, then sitemap inclusion.
- Use absolute URLs in `<link rel="canonical" href="...">`, in the `<head>`, one per page.
- Do not use robots.txt or the URL removal tool for canonicalization.
- Do not point a canonical to a URL that is noindex, redirects, or returns an error.
- "Alternate page with proper canonical tag" in Search Console is normal when the canonical points to the main URL.

## Workflow
1. List URL variants: http and https, www and apex, trailing slash, uppercase, query parameters, print views, pagination.
2. Choose one preferred form for the site. Redirect other host and protocol forms with 301.
3. On each page, add a self-referencing canonical to the preferred URL.
4. For true duplicates (same content on two paths), point the canonical of the copy to the main page, or redirect.
5. Make the sitemap list only canonical URLs. Make internal links use canonical URLs.
6. For single-page apps, put the canonical in the raw HTML, not only after JavaScript runs.

## Checks
- [ ] Each indexable page has exactly one canonical, absolute, returning 200.
- [ ] Canonical, sitemap and internal links agree.
- [ ] URL Inspection shows "Google-selected canonical" equal to "User-declared canonical".

## Output
A table: URL, current canonical, new canonical, other fixes (redirect, sitemap, link).

## Sources
- Google: How to specify a canonical URL with rel="canonical" and other methods. https://developers.google.com/search/docs/crawling-indexing/consolidate-duplicate-urls
