AI search, SEO & online discovery
Practical coverage from Dubai

Saved
Technical SEO

How to Check Canonical URLs After a Website Migration

Summarize with AI
Website development and code review; illustrative photograph.
Photo by Digital Buggu / PexelsIllustrative photography
In this article 5 sections

The old address redirects to the new page and the new page opens normally. Then someone checks the new page’s source and sees that it still declares the old address as canonical. The redirect sends visitors forward while the canonical points back. A migration can produce this conflict when routing and page templates are changed by different teams.

Start from the migration map and test each sampled pair as a unit. Record where the old address leads, what the new page declares, and whether internal links and the sitemap agree. Check the rendered page if scripts can change the declaration. With access to the search platform, separately record which URL it selected. The existing AI Visibility internal linking guide covers how useful pages are found through links. This walkthrough checks whether several migration signals point to the same destination. AI Visibility internal linking guide · Google canonicalization guidance

Use the URL map as the test plan

Give each old address an expected outcome. A page with a direct replacement can point to the corresponding new page. A group of pages may have a single suitable replacement if the new page genuinely consolidates their content. A removed page may need to return the appropriate removal status. Document which case applies before testing. A redirect to a generic homepage can look successful in an automated status report while leaving the user without the article or service they requested. Google guide to site moves with URL changes

Choose test rows by template and migration rule. Include the homepage, deeper pages, historically important pages, alternative hostnames, changed paths and relevant language variants. Add any known exception that uses another redirect or page template. Keep the old and new full addresses in the same row. If tracking parameters or trailing slashes matter to your migration, test the variants users or systems actually link to and record which one you expect to be preferred.

Evidence What to record Example of a mismatch
Old address response Status of each hop and final URL Old article lands on a generic homepage
New page HTML Declared canonical and its resolved target New page points to its old address
Response headers Any applicable Link canonical and response status Header and HTML identify different targets
Sitemap and internal links Where discovery sources send readers New sitemap still lists old routes
Search platform report Selected canonical, reported URL and crawl date Indexed report still selects the old version

Read the redirect and canonical separately

Fetch the old address with a bounded redirect follow. Save every response header block and the final body. Then request the expected new address directly to check what it returns without going through the old host. For an old URL that is supposed to move permanently, the team can verify the redirect status and its destination against the plan. The destination itself should provide the intended content and respond as expected. Google guide to site moves with URL changes

old_url='https://example.com/replace-with-the-old-path'
curl --silent --show-error --location --max-redirs 8 --max-time 20 \
  --dump-header old-chain.headers --output destination.html \
  --write-out 'status=%{http_code} final=%{url_effective} redirects=%{num_redirects}\n' \
  "$old_url"
grep -iE '^(HTTP/|location:|link:|content-type:)' old-chain.headers

Inspect the final HTML head and any Link headers for a canonical. If the page uses both, compare the targets. Google recommends using one method consistently because competing declarations can be harder to maintain. Use absolute addresses in the declarations where possible. If you find a relative value, resolve it against the document’s effective base URL before comparing it. A canonical found in a markup example or outside the usable head should be recorded separately from the valid declaration the platform documents. Google canonicalization guidance

Check that the canonical destination can be fetched and that it represents the page or cluster of near duplicates you intend to consolidate. Compare the main heading or another stable content marker with the expected page. A new URL can respond with 200 and still be the wrong page. If the preferred page redirects again, examine where the chain ends and update the signals to point directly to the intended live destination. Where the pages serve distinct language or audience needs, review their intended relationship before consolidating them. Google canonicalization guidance

Add a separate test row for documents if they are part of the move. A PDF can declare a canonical in an HTTP Link header under Google's documented method. A viewer may display the file correctly while the header still names its former path. Fetch the document itself and inspect its headers. Check where the download link in the new site points and where the old download redirects. That gives the owner three concrete places to fix if a document migration differs from the HTML templates. Google canonicalization guidance

Compare original HTML with the rendered declaration

Inspect the original response body, then load the destination in a clean browser and inspect its rendered head. In the developer console, this expression returns both the value written in the DOM and the resolved URL for each canonical link.

Array.from(document.head.querySelectorAll("link[rel~='canonical']"))
  .map(link => ({ declared: link.getAttribute("href"), resolved: link.href }))

Record the original and rendered results separately. If a script changes a correct source canonical to an old route, trace the client-side template or head manager. If the original declares the old address and the DOM shows the new one, fix the source where possible. Google advises keeping canonical information clear and avoiding changes to a declaration already present in HTML source. A clean browser observation shows what the tested browser received and rendered. It does not show which URL Google selected. Google canonicalization guidance

Test a direct load and, if the site uses client-side navigation, a visit from another page. A stale declaration from the prior route can appear only in one journey. Compare pages served by different content templates. A correct homepage gives little information about the rule generating canonicals on product pages or archived articles. Retain the raw response, the rendered value and the test sequence if you find a difference.

Follow a real public migration pair

Smith College Athletics publicly announced that its athletics site moved to gosmithbears.com and updated its Instagram handle. The official announcement embeds a Smith Bears post. It provides a dated source for the move and an example of public communications changing alongside web addresses. The HTTP and HTML observations below come from separate requests. Smith Athletics domain and social announcement

On 6 November 2026, the old homepage at smithpioneers.com returned HTTP 301 to gosmithbears.com, which returned HTTP 200. The old women’s basketball path also returned HTTP 301, keeping the path on the new host, followed by HTTP 200. Direct GETs to both new addresses returned HTTP 200. The new homepage’s source declared the new domain and the basketball page declared its own new path. That second pair shows why it is worth testing a deep page separately. A root redirect alone cannot confirm that deep links survived. Old women’s basketball URL · New women’s basketball URL

A clean Chrome run on the new basketball page exposed the same canonical in the rendered head as in the initial response. The observations cover two URL pairs and one rendered destination. Private logs, the site’s full redirect map and the search engine’s selected canonicals were outside the test. Use the example to reproduce the procedure on an owned site with access to those additional records.

Check discovery signals before closing the migration

Compare the preferred destinations against the sitemap and links that point to them. Google describes redirects and canonical declarations as strong signals, with sitemap inclusion a weaker one. It recommends consistent internal links to preferred URLs. During a migration, check whether templates, breadcrumbs and high-traffic content still point to old addresses that redirect. Replace those links with the new URLs where you control the source. Treat an old sitemap kept temporarily for monitoring as a separate migration artefact and identify which sitemap is intended to describe the new canonical set. Google canonicalization guidance · Google guide to site moves with URL changes

Preserve the distinction between tracking parameters and parameters that materially change what the visitor sees. A campaign parameter might keep the same content and point to the clean page. A parameter that selects a different language or a materially different item deserves its own review. For multilingual pages, inspect the matching language destinations and the alternate links together. Google recommends using a canonical in the same language where possible for pages using hreflang. Keep a representative language pair in the test plan if the migration changes the way language is encoded in URLs. Google canonicalization guidance

Use a Migration canonical record for each sample. Include the old URL, expected destination, status chain, final status, original canonical, rendered canonical, internal link or sitemap evidence and the owner of any mismatch. Give the technical team the source of the disagreement. If the old link lands correctly but the new HTML points back, the page template is the first place to investigate. If the canonical is correct but a menu uses old links, the navigation owner can update the menu and verify the same samples.

If you have permission, inspect the new and old addresses in Google Search Console. Record the user-declared and Google-selected canonicals where available, along with the reported crawl date. The live test can help examine current delivery. The indexed view provides the selected canonical known to the report. These may refer to different moments. Use permitted edge or origin logs to confirm observed requests to old and new routes if the issue persists, and verify the requester before attributing it to a platform. Google Search Console URL Inspection · Google requester verification guide

If the declared canonical and the indexed selection disagree, compare the content and signals on both candidates. A stale crawl is one possibility. A still-live duplicate with prominent internal links and inconsistent declarations is another. Record what supports each explanation, correct the signals you control and use the later report to see whether selection changes. Avoid treating the report as a verdict on every other URL in the migration.

Close the implementation issue when the sampled redirects, declarations and discovery signals agree with the migration map. Keep a separate follow-up if indexed selection has yet to be observed. Expand the sample when an issue affects an entire template or path rule. Keep redirects for the period the migration plan requires. Google recommends keeping them for at least a year where possible and considering longer retention for users who still follow old links. Google guide to site moves with URL changes

AI Visibility is published by Lunasol, which offers GEO and AEO services. The Smith Athletics example uses public HTTP and browser observations. About AI Visibility

You’ve reached the end of this article. Read as plain text

Search the blog

Summarize with AI

Choose your assistant. Copy the article and summary request, then paste it into a new chat.

The full article is included, so your assistant can read it without opening this website. Nothing is submitted automatically.

View or copy the summary requestOpen assistant

Summaries are generated by your chosen service and may miss details. Its account requirements and terms apply.