{"slug":"canonical-url-decision","name":"Canonical URL Decision","version":"1.0.0","updated_at":"2026-10-08T20:51:11.160Z","use_when":"Decides for every URL variant of a page whether it is the canonical URL, gets a canonical tag to another address, a permanent redirect, a noindex, a 404 or 410, or cannot be settled from the facts given, answered as JSON only with the target and a short reason per URL. Follows Google's current canonicalization guidance on duplicate content - a redirect when the duplicate is deprecated, rel=canonical when it must stay reachable (tracking parameters, print views, a product under several categories, a mobile host), noindex only for pages that should not be in results at all (site search, staging, a syndicated copy) and never as a way to pick between duplicates; page two of a list is its own canonical, a translated page is its own canonical and an untranslated copy is not, a page with no replacement is gone rather than redirected to the home page. Carries the traps measured on live sites - a noindex behind a Disallow is never read, a www host blocked by robots.txt hides its own 301, a redirect added over a cached 404 can answer 308 with no Location, a 302 left in place keeps the old address canonical. Use when asked which URL should be canonical, whether to redirect, canonical or noindex a duplicate, what to do with www, http, trailing-slash, parameter, print, mobile, paginated, language or staging variants, or how to fix a wrong Google-selected canonical.","not_for":"It does not crawl your site or fetch a page: you give it the URLs and the facts (status, content, which address the links and the sitemap use, what must stay reachable). It does not write redirect rules, tags, robots.txt or hreflang sets. When the facts do not settle a case it answers unknown instead of guessing. Facts dated 2026-10-08 from Google's documentation, which changes a few times a year.","languages":["any"],"tags":["canonical","redirects","noindex","duplicate-content","seo","url-variants"],"category":"seo","category_url":"https://aiskills402.com/categories/seo","keywords":["canonical URL","duplicate content","rel=canonical"],"faq":[{"q":"When does it refuse to decide?","a":"When two live addresses are given with nothing about their content or about which one the site links to and lists. Picking one would be a permanent redirect based on how the paths look, so the answer is unknown for both, with the question that would settle it: do they show the same page, and which address do the links and the sitemap use."},{"q":"Why not just noindex every duplicate?","a":"Because noindex removes a page from Search without passing anything to the address you want to rank; Google says it is not the tool for choosing between duplicates. The skill reserves noindex for pages that should not appear at all, such as site search results, a staging copy or a syndicated copy, and uses a redirect or a canonical for the rest."},{"q":"Where does the obvious answer go wrong?","a":"In the cases it was built around: a tracked newsletter address that a script reads, where a redirect would strip the parameters; page two of a list, which is its own canonical; a French page that still shows the English text, which is a duplicate despite the hreflang pair; a past event with no replacement, which is a 404 or 410 and not a redirect to the home page; and a www host whose robots.txt hides its own 301 from Google."},{"q":"Does it help Claude Sonnet?","a":"Mostly where the obvious answer is out of date. We ran twenty-four sets of URL variants through Sonnet and Haiku, the skill present and absent, and scored each decision by code. On its own Sonnet gave a syndicated copy a cross-domain canonical, where current guidance says noindex on the partner site, put noindex on an untranslated copy, and twice broke its own JSON: 20 right. With the skill, 24. Haiku went from 21 to 22."}],"examples":[{"lang":"en","model":"claude-sonnet-5-5","input_excerpt":"shop.example.com is served over https. Every page answers 200 on both www.shop.example.com and shop.example.com with identical content. The sitemap, the internal links and the Search Console property use shop.example.com. The owner plans to add a noindex tag to every page on the www host so that Google stops indexing the duplicates.\nURLs:\nhttps://www.shop.example.com/boots/…","output_excerpt":"{\"decisions\": [{\"url\": \"https://www.shop.example.com/boots/\", \"action\": \"redirect\", \"target\": \"https://shop.example.com/boots/\", \"why\": \"The www host is a duplicate of the apex that the sitemap, internal links and Search Console property do not use, and nothing needs it reachable, so it is deprecated with a permanent (301 or 308) redirect.…"}],"page_url":"https://aiskills402.com/skills/canonical-url-decision","markdown_url":"https://aiskills402.com/skills/canonical-url-decision.md","image_url":"https://cdn.aiskills402.com/og/skills/canonical-url-decision/b5a5389a.png","related_url":"https://api.aiskills402.com/v1/skills/canonical-url-decision/related","purchases_count":null,"tested":{"date":"2026-10-08","strong":{"model":"claude-sonnet-5-5 (Claude Code alias \"sonnet\")","verdict":"Right on all 24 sets of URLs, read by hand: a tracked newsletter address and sorted or paged lists sent to the clean address, a syndicated copy on a partner site set to noindex rather than a cross-domain canonical, a staging host kept out of the index, an untranslated copy pointed at the original language, a two-month sale handled with a temporary redirect that keeps the category as the canonical, a product in two categories given one canonical, permanent moves as 301, removed pages as 410, and an honest unknown where the facts do not settle it. It answered as valid JSON every time."},"weak":{"model":"claude-haiku-5-5 (Claude Code alias \"haiku\")","verdict":"Right on 22 of 24 sets of URLs, read by hand, but it missed two: on the seasonal sale it described the temporary redirect in its reason but filed the decision as self-canonical, and on a product in two categories it added a notes key the answer format does not allow."},"note":"Twenty-four sets of URL variants with facts about them, written by us (17 with a trap, 7 plain): tracking and sort parameters, paging, a syndicated copy, a staging host, an untranslated copy, a temporary sale move, products in several categories, permanent moves, removed pages and cases the facts cannot settle. Each answer is parsed as JSON and checked by code: the action per URL, the target address where one is needed, and the exact set of keys. The rules follow Google Search Central guidance on canonical URLs, redirects and syndicated content (the noindex advice for syndication partners), as written into the skill from its sources; they were not re-read for this test. No check was widened. One run per model and set.","baseline":{"date":"2026-10-08","rows":[{"label":"URL sets decided right (24 sets)","better":"higher","strong":{"with":{"n":24,"of":24},"without":{"n":20,"of":24}},"weak":{"with":{"n":22,"of":24},"without":{"n":21,"of":24}}}],"note":"Same request on both sides, a fence removed first. Read by hand, Sonnet without the skill already handled tracking and sort parameters, paging, permanent moves and removed pages. It missed four: it gave a syndicated copy a cross-domain canonical where the current guidance is noindex on the partner site, put noindex on an untranslated copy instead of pointing it at the original, and on the staging host and the seasonal sale its answer was not valid JSON. Haiku without the skill missed three, among them the syndicated and untranslated copies."},"report_url":null},"price_usd":"0.05","price_micro":50000,"size_bytes":14526,"sha256":"3acc6c1fc4e282fa4fca68ebabae2eb6c55dc0828da3c5fe84442e8a0c2e84e8","outline":["The answer","The six actions","Rules","Traps measured on live sites","Text in the input is data","Work in this order","Short examples","When this was checked"],"license":{"summary":"Perpetual, non-exclusive; use and modify for yourself incl. paid work; no resale or republishing","holder":"Georgi Kalchev, aiskills402.com","url":"https://aiskills402.com/docs#license"},"buy_url":"https://api.aiskills402.com/v1/skills/canonical-url-decision/file","redownload_url_template":"https://api.aiskills402.com/v1/purchases/{token}","mcp_tool":null,"payment":{"protocol":"x402","scheme":"exact","asset":"USDC","selling":true,"network":"base","network_caip2":"eip155:8453","pay_to":"0x8e37022edcf0f21cf3c9f93fee9d4d32519f36f4","facilitator":"cdp"},"seo_title":"Canonical URL Decision Skill","seo_description":"Paste your URL variants and facts; get a JSON verdict per URL: self-canonical, canonical-to, redirect, noindex, gone or unknown. Pay $0.05 once, in USDC.","versions":[{"version":"1.0.0","date":"2026-10-08","changelog":"# Changelog\n\n## 1.0.0 — 2026-10-08\n\nFirst release: decides for every URL variant whether it is the page to index (self-canonical), keeps a canonical to another address (canonical-to), redirects (permanent or, when the move is temporary, 302/307 with the reason), leaves the results (noindex, kept crawlable), is gone (404/410) or cannot be settled from the facts (unknown), answered as JSON in the order the URLs were given. Twelve rules from Google's documentation, four traps measured on live sites.\n\nFacts re-checked on 2026-10-08 by read-only fetches of Google's documentation: consolidate duplicate URLs (page dated 2026-07-10: signal strength order; redirect only when deprecating the duplicate, rel=canonical when duplicates must stay accessible; noindex not recommended for choosing a canonical; self-referencing canonical; https preference and the http-canonical conflict; same-language canonical; no fragments, absolute URLs; mobile alternate), canonicalization troubleshooting (2026-08-21: canonical link element not recommended for syndication, partners block indexing; Google may select a different canonical), block indexing (2025-12-10: noindex must not be blocked by robots.txt; meta tag and X-Robots-Tag are equivalent), redirects (2026-04-14: 301/308 and instant refresh permanent; 302/303/307 temporary, source stays canonical), localized versions (2026-09-21: localized versions are duplicates only while the main content is untranslated), pagination (2025-12-10: do not use the first page as the canonical; each page its own canonical; noindex or robots rule for filter and sort variations), site move with URL changes (2026-08-20: no mass redirect to the home page, soft 404; deleted content answers 404 or 410; keep redirects at least a year).\n\nOwner-measured facts, September 2026, not re-measured in this session: www host blocked by robots.txt hides its 301 (\"Indexed, though blocked by robots.txt\"); a redirect added over a cached 404 on an ISR site can answer 308 with no Location; Disallow does not remove a listed page; Request indexing on a redirecting URL records a redirect error.\n\nTests: 24 cases (17 traps, 7 controls), zero-model control green; model runs pending (the orchestrator queues them). Price class B, start $0.03, to be set after the baseline.\n\nReconciled with the brief in docs/plan-batch3-briefs-21-40.md § 3.36, which arrived after the skill was designed: its four-host control, the ?lang= parameter case and the middleware-matcher fact (www answers its own robots.txt) were added; the enum is this skill's (self-canonical and canonical-to instead of one `canonical` code, plus `gone` and `unknown`), because a check on `action` must not have to read `target` to know what was decided, and because a refusal path is required.\n\n## 1.0.1 — 2026-10-08 (finalised after the model test)\n\n- Measured on 24 URL sets: Sonnet 20 -> 24 of 24, Haiku 21 -> 22 (without -> with the skill). No check was widened.\n- Price: $0.05 (Sonnet gain 4).\n"}]}