How to Fix Canonical Tags Pointing to Non-200 URLs
A canonical tag tells search engines which URL is the main version of a page. If that URL redirects, returns a 404, or throws a server error, the signal is contradictory and usually gets ignored. By the end of this guide, every canonical on your site will point to a live, indexable URL that returns HTTP 200 directly.

Why it matters
Google treats rel=canonical as a hint. When the hinted URL redirects or is broken, Google often discards it and picks its own canonical, which may be a parameter URL, an http version, or a duplicate. Ranking signals then split across duplicates, the wrong URL shows in search results and AI answer citations, and a canonical pointing to a 404 can make Google drop the page you actually wanted indexed.
Because the cause is usually one template or one site setting, a single fix often clears hundreds of pages.
What you need
Step-by-step fix
List each flagged page and its canonical target
Export the affected URLs from the audit. For each page, record the exact href in its canonical tag. The audit only flags pages whose canonical differs from the page's own final URL, so you are looking at canonicals that point somewhere else.
Even a small difference counts, such as http vs https, www vs non-www, or a trailing slash.
curl -s https://example.com/shoes/ | grep -io '<link[^>]*rel="canonical"[^>]*>'
Check the status code of every canonical target
Put the canonical URLs in a file, one per line, and request each one without following redirects. Only a direct 200 passes. A 301 or 302 fails here, even if the redirect ends on a working page.
while read u; do printf "%s %s\n" "$(curl -s -o /dev/null -w '%{http_code}' "$u")" "$u"; done < canonicals.txtClassify the failures by cause
Group the results, because each group has a different fix:
- 301/302/307/308: the canonical uses an old, http, www/non-www or slash variant. Point it to the final destination URL.
- 404/410: the target was deleted or moved. Point to the live replacement, or make the canonical self-referencing.
- 401/403: the target is behind a login, geo-block or bot protection. Canonicals must point to publicly accessible URLs.
- 5xx: the target is erroring. Fix the server issue, or point to a stable URL.
Fix the site-wide canonical base URL
Most redirecting canonicals come from a wrong base URL in settings. com/. Then make sure the template builds canonicals from that base as absolute URLs.
Strip tracking parameters, but keep parameters that change content, such as pagination if you index paginated pages.
<link rel="canonical" href="https://example.com/shoes/">
Correct per-page canonical overrides
Some pages have a canonical typed in by hand, often pointing to a product, post or category that was later deleted or renamed. Open each remaining flagged page in your CMS and update or clear the canonical override field. If there is no clear replacement, clear it so the page falls back to a self-referencing canonical.
Align redirects, sitemap and internal links
Every canonical target should also be the URL listed in your XML sitemap and used in internal links. Update the sitemap entries and menu links to the same 200 URLs. If you just added a redirect to consolidate URLs, update the canonicals at the same time, so none of them point at the redirected source.
Re-test and re-crawl
Purge any page cache or CDN cache, then run the curl status loop from step 2 again on the new canonical targets. Every line should show 200. Re-run the site audit to confirm that fewer than 1% of pages remain flagged.
Then use URL Inspection in Google Search Console on a few key pages to request reindexing.
while read u; do printf "%s %s\n" "$(curl -s -o /dev/null -w '%{http_code}' "$u")" "$u"; done < canonicals.txt | grep -v '^200'Platform-specific notes
WordPress
Set Settings > General > WordPress Address and Site Address to your exact https URL. Per-post overrides live in Yoast (post editor > Yoast SEO > Advanced > Canonical URL) or Rank Math (Rank Math panel > Advanced > Canonical URL). Check the permalink trailing-slash style in Settings > Permalinks, because a mismatch triggers 301s.
Shopify
Themes output {{ canonical_url }} in theme.liquid. It follows the primary domain set in Settings > Domains. If an old domain is still primary, or the theme hardcodes a URL, canonicals will redirect. Search your theme code for hardcoded rel="canonical" tags in sections or apps.
Next.js
Set metadataBase in the root layout (for example, new URL('https://example.com')) and alternates.canonical in each page's metadata or generateMetadata. Make the trailingSlash setting in next.config.js match the canonical paths, or every canonical will 308.
Webflow
Set Site settings > SEO > Global canonical tag URL to https://example.com with no trailing slash, matching your published default domain. Per-page canonical overrides are under Page settings > SEO settings. CMS template pages build canonicals from the collection slug, so renamed slugs that redirect need re-publishing.
Cloudflare
Rules such as Always Use HTTPS, or a Redirect Rule forcing www, will 301 any canonical that uses the old variant. Fix the canonicals at the origin rather than removing the rule. Also confirm that Bot Fight Mode or WAF rules don't return 403 to crawlers on canonical URLs.
Check that it worked
✅ How to verify
- Run the curl status loop on all canonical targets without -L and confirm every one returns 200.
- Re-run the audit and confirm the 'Canonical points to non-200 URL' check passes, with fewer than 1% of pages flagged.
- In Google Search Console, use URL Inspection on a fixed page and check that 'User-declared canonical' matches 'Google-selected canonical' after recrawl.
- Spot-check the live HTML (View Source) on two or three templates to confirm the canonical uses https, the correct host and the correct trailing-slash style.
⚠️ Common mistakes
- Testing canonical targets with redirects followed (curl -L or a browser), which hides the 301 that search engines actually see.
- Fixing pages one by one when the real cause is a global setting, such as an http site URL or the wrong primary domain.
- Pointing canonicals of deleted or merged pages to the homepage, which Google treats as a soft 404 and ignores.
- Updating redirects after a URL change but leaving canonicals, sitemap entries and hreflang tags on the old URLs.
Is this still an issue on your site? Run a free audit — ZORO checks this and 294 other SEO, AI-visibility, accessibility and security signals, with fixes for your platform.
Check my site freeFAQ
Is it bad if my canonical points to a URL that 301 redirects?
Yes. The page says 'index URL A', while URL A says 'go to URL B'. Google may still work it out, but it often ignores the hint and picks its own canonical. Point the canonical straight to the final 200 URL.
Should every page have a self-referencing canonical?
For pages that are the main version, yes. A self-referencing canonical with the exact https URL that returns 200 is the safest default. Only point elsewhere when the page is a true duplicate or variant of another live page.
Can a canonical point to a noindex page?
It shouldn't. A canonical target must return 200 and be indexable. Pointing to a noindex, blocked or login-protected URL sends conflicting signals, and Google will usually ignore the canonical.
How long does Google take to pick up corrected canonicals?
It happens on recrawl, typically within days for important pages and a few weeks for deeper ones. Requesting indexing in URL Inspection and resubmitting your sitemap can speed up the key URLs.
How to Fix Conflicting Canonical and Noindex Tags
How to Fix Duplicate URL Variants (Case, Slash, Index)
How to Fix Index Coverage Gaps in Google Search Console
How to Fix Crawl Budget Waste from URL Parameters
How to Fix Structured Data Errors on Your Website
How to Fix JavaScript-Dependent Content for Crawlers and AI