canonicals
Skill0 starsChanged 3 days agoMITView on GitHub
Choose between rel=canonical, 301 redirects, noindex and robots.txt for duplicate or near-duplicate URLs, and detect canonical conflicts: canonical pointing to a redirect or noindex page, multiple canonicals, relative canonicals, canonicals set by JavaScript, and Google choosing a different canonical than the user. Use when the user asks 'canonical tag', 'duplicate content', 'Duplicate without user-selected canonical', 'Google chose different canonical', 'Alternate page with proper canonical tag', 'which URL should rank', 'parameters or www/https duplicates', or 'canonical vs redirect vs noindex'. Uses sitetiller page, pages and inspect.
In this repository44 other files it gives its agents.
- AGENTS.mdAGENTS.md
- agent-readySkill
- ai-citationsSkill
- ai-crawlersSkill
- ai-logsSkill
- ai-trackerSkill
- backlinksSkill
- cannibalizationSkill
- citabilitySkill
- comparison-pagesSkill
- competitorsSkill
- content-briefSkill
- content-decaySkill
- content-qualitySkill
- core-web-vitalsSkill
- ecommerce-seoSkill
- ga4-aiSkill
- ghost-publishSkill
- gsc-bingSkill
- hreflangSkill
- imagesSkill
- indexingSkill
- internal-linksSkill
- llms-txtSkill
- local-seoSkill
- measure-rollbackSkill
- onpageSkill
- platformsSkill
- pseo-quality-gateSkill
- quick-winsSkill
- redirects-migrationSkill
- schemaSkill
- seo-planSkill
- seo-reportSkill
- setupSkill
- site-architectureSkill
- sitemapsSkill
- static-site-publishSkill
- sxoSkill
- tech-auditSkill
- titles-metaSkill
- topic-clustersSkill
- weekly-checkSkill
- wordpress-publishSkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 5 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 31
Prefer HTML. If JavaScript must set it, do not change it from what the original HTML says, and never inject a second one.
- Very specific: line 54
Check the sitemap lists only the preferred URLs (sitemaps skill, sitemap command sample[]: redirects and noindex).
- Distinctive: line 55
Ask Google what it chose (Search Console access needed):
- Distinctive: line 82
Do not use noindex or robots.txt to resolve duplicates within a site.
- Distinctive: line 83
Do not call duplicate content a penalty.
- Distinctive: line 84
Do not set canonicals across unrelated pages.
- Very specific: line 85
Do not suggest rel=canonical for syndicated content: Google's troubleshooting page says the pages are often very different.
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Canonicals
Goal: for each group of duplicate URLs, one preferred URL, declared with consistent strong signals, and a check that Google agrees. Google is clear that a canonical preference is a hint and not a rule: it may choose another URL.
Choose the tool
| Situation | Use | Google's description |
| Old URL should disappear for good | 301 or 308 redirect | "a strong signal that the target of the redirect should become canonical" |
| Duplicates that must both stay reachable (parameters, print versions, similar pages) | rel="canonical" | "a strong signal" |
| Preferred URLs listed in the sitemap | sitemap inclusion | "a weak signal"; use it as a supporting signal |
| Page must stay out of search results | noindex | not a canonicalization tool: Google does not recommend noindex to prevent selection of a canonical within one site |
| Keep a page from being crawled | robots.txt | do not use for canonicalization; a blocked page's tags are never read |
| Non-HTML file (PDF) | Link: <url>; rel="canonical" HTTP header | works for non-HTML files |
Methods can stack. Do not name different canonicals in different methods for the same page.
Rules for the tag (Google)
- Absolute URL, not relative.
- Inside
<head>; it is only accepted there. - One canonical per page. Use the HTML element or the HTTP header, not both.
- The canonical page carries a self-referencing canonical.
rel="canonical"withhreflang,lang,mediaortypeattributes is not used for canonicalization.- Prefer HTML. If JavaScript must set it, do not change it from what the original HTML says, and never inject a second one.
Steps
- Read one page:
Fields:npx sitetiller page https://example.com/shoes?color=red --jsoncanonical(first one found),canonicalCount,finalUrl,chain,noindex,robotsMeta,xRobots,robotsTxtGooglebot,hreflang[]. Reads HTML<link rel="canonical">only;Link:header canonicals are not read, and JavaScript is not run. - Flag in each page:
Result Meaning Fix canonicalCount0 on a page with duplicatesno declared preference add a self-referencing canonical canonicalCountabove 1conflicting tags (often a theme plus an SEO plugin) keep one; Google warns against multiple canonicals canonicaldiffers fromfinalUrlpage defers to another URL confirm that is intended canonicalis relativenot recommended by Google make it absolute canonical target redirects, 404s, or has noindexcontradictory signals (our recommendation: Google's pages read do not name this case, but a canonical should name the page you want indexed) point it at the final, indexable URL: check it with pagecanonical on http://while the site serves httpswrong protocol use https noindexplus a canonical to another pagemixed message choose one: noindex to exclude, or canonical to consolidate - Sample the site:
Innpx sitetiller pages example.com --pages 40 --jsonpages[]compare eachcanonicalwith itsurl; list pages whose canonical is empty or points elsewhere.summary.duplicateTitlesandsummary.duplicateDescriptionsgroup pages that probably compete; check each group has a deliberate canonical. - Check the sitemap lists only the preferred URLs (
sitemapsskill,sitemapcommandsample[]: redirects and noindex). - Ask Google what it chose (Search Console access needed):
Comparenpx sitetiller inspect example.com https://example.com/shoes?color=red --jsonuserCanonical(declared) withgoogleCanonical(selected).googleCanonicalis absent when the page is not indexed. Equal: fine. Different: Google disagrees; see below. - For many near-duplicate pages that compete for the same queries, use the
cannibalcommand on a query-page export (not covered here).
Search Console statuses about duplicates
| Status (Page indexing report) | Meaning | Action |
| Alternate page with proper canonical tag | page is an alternate of an indexed canonical | none, intended |
| Duplicate without user-selected canonical | duplicate, no canonical declared, Google picked one | declare a canonical, or make the content substantially different |
| Duplicate, Google chose different canonical than user | Google thinks another URL is better | inspect both URLs; check the declared canonical is truly similar and the better page; make the clustered pages meaningfully different if they should both rank |
| Page with redirect | non-canonical URL that redirects | usually none |
Google says duplicate clusters may persist up to two weeks after fixing, and Request Indexing is quota-limited, so use it only for key URLs.
Causes Google lists when it picks the wrong canonical
A CMS or plugin emitting wrong canonicals or redirects; servers returning another domain's content or identical soft 404 pages; hacked sites with injected redirects or cross-domain canonicals; language or regional variants without hreflang; syndicated copies (canonical not recommended, ask partners to block indexing); copycat sites. Fix the cause the evidence points to.
Output to the user
- The preferred URL for each duplicate group, and the signal used (redirect, canonical, both plus sitemap).
- A table of conflicts found with the
pageorinspectfield that proves each. - The exact tag or redirect rule to put in place.
- Honest expectations: Google may still choose differently; allow up to two weeks for re-evaluation.
Guardrails
- Do not use noindex or robots.txt to resolve duplicates within a site.
- Do not call duplicate content a penalty. The Google pages read describe duplicates as Google choosing one canonical URL; none of the statuses is a manual action.
- Do not set canonicals across unrelated pages. Google says it weighs content and technical signals and can override the declared canonical.
- Do not suggest
rel=canonicalfor syndicated content: Google's troubleshooting page says the pages are often very different. - State what the tool cannot see: HTTP header canonicals, JavaScript-set canonicals, and Google's chosen canonical without Search Console access.
References
references/sources.md: Google documentation, checked 2026-11-12.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

