Skip to the indexed answers
Digital Marketing Index

usdigitalmarketingindex.com SEO

Which canonical link elements must change when page URLs are migrated?

Every one that names an old URL. On the new pages, each canonical element must name that page’s new address. On pages that did not move but reference moved pages as their canonical, the reference must be updated. And every other place the site states a preferred URL, the canonical HTTP header, the XML sitemap, hreflang annotations, and internal links, must change to match. Google’s site move guidance puts it as a step after redirects go live: ensure that the canonical annotations on the new site are using the new URLs (Google’s guidance on site moves with URL changes). A canonical that still names an old URL contradicts the redirect from that old URL. One says “the new address replaces the old”, the other says “the old address is preferred”.

Old URLs and redirects

Start with what happens at the old addresses.

Once an old URL returns a redirect, its own HTML is no longer served, so any canonical tag in the old page is moot. The redirect is the signal from that address.

What matters about old URLs:

Check Why
Each old URL redirects to its new URL The redirect and the new page's canonical must name the same address
The redirect target is the canonical form Same scheme, host, case, and trailing slash as the canonical tag on the destination
No old URL still returns 200 A live old page with a self-canonical competes with the new one
Old URLs kept live deliberately If an old page stays up with a canonical to the new URL in place of a redirect, the tag must name the new URL exactly

A redirect to one form of the URL and a canonical naming another form, such as with and without a trailing slash, creates a small disagreement on every page. Decide the canonical form once and use it in both.

Canonical tags on new pages

The places a canonical reference can live, all of which need checking:

Location Form Fault to look for after migration
HTML head The link element with rel canonical Hard-coded old domain or old path in the template
HTTP response header A Link header with rel canonical, used for PDFs and other non-HTML files Server configuration left pointing at old URLs
Pages canonicalized to another page Variants, parameter URLs, syndicated copies pointing at a main URL Still naming the main page's old address
Paginated and filtered pages Self-referencing or pointing to a base URL Base URL not updated
Alternate versions Mobile, print, or AMP pages pointing to the main version Old main URL
Cross-domain canonicals Partner sites canonicalizing to your content Still naming your old URLs; needs a request to the partner

How the faults arise:

  • the staging domain was left in canonical tags at launch;
  • the CMS stores the canonical per page as an absolute URL, and the stored values were migrated unchanged;
  • an SEO plugin holds manual canonical overrides entered years earlier;
  • the template builds the canonical from a configuration value for the site address that was not updated;
  • protocol or host in the canonical differs from the one the redirects enforce.

Rules for the new pages:

  1. Each indexable page has one canonical element.
  2. It is an absolute URL.
  3. It names the page’s own new URL, unless the page is intentionally canonicalized elsewhere.
  4. Where it names another page, that page’s new URL is used.
  5. The URL it names returns 200, is not redirected, and is indexable.

Sitemaps and internal links

Canonical tags are one of several signals about the preferred URL, and Google’s guidance on ecommerce URL structure asks sites to use “the same URL in internal links, sitemap files”, and canonical tags (Google’s guidance on URL structure for ecommerce sites). After a migration, each of these needs the new URLs.

Signal Required state
XML sitemap Lists only new, canonical URLs; the guidance says to submit the new sitemap
Internal links Point to new URLs directly; the guidance says to change internal links from old URLs to new
hreflang annotations Name new URLs, which are themselves canonical
Structured data URLs New URLs
Open Graph URL New URL
Pagination links New URLs
Redirect targets The canonical form
Canonical tags As above

When these disagree, for instance a sitemap listing old URLs while canonicals name new ones, Google has conflicting statements to weigh. Agreement is the goal.

Conflict testing

An old and new canonical audit checklist for a few migrated URLs. The site is hypothetical, moving from /services/boiler-repair.html to /boiler-repair/.

Old URL Old URL response New URL New URL status Canonical on new page Header canonical In sitemap Internal links to old URL Result
/services/boiler-repair.html 301 to /boiler-repair/ /boiler-repair/ 200 /boiler-repair/ None New URL 0 Pass
/services/boiler-service.html 301 to /boiler-service/ /boiler-service/ 200 /services/boiler-service.html None New URL 0 Fail: canonical names old URL
/services/heating.html 301 to /heating/ /heating/ 200 /heating None New URL 14 Fail: canonical form differs (no trailing slash); internal links not updated
/downloads/guide.pdf 301 to /guides/guide.pdf /guides/guide.pdf 200 Not applicable /downloads/guide.pdf Not listed 2 Fail: header canonical names old URL
/services/boiler-repair.html?ref=nav 301 to /boiler-repair/ /boiler-repair/ 200 /boiler-repair/ None Not applicable 0 Pass

Tests to run across the site:

Test Method Pass condition
Old domain or old path in canonicals Crawl the new site; filter canonical values containing old patterns None
Staging hostname in canonicals Same crawl; filter for the staging host None
Canonical target status Request every distinct canonical URL 200, no redirect
Self-reference Compare each page's URL with its canonical Equal, except intended exceptions
Canonical and redirect agreement For each old URL, compare the redirect's final URL with the canonical on that page Equal
Header canonicals Request non-HTML files; read Link headers New URLs
Multiple canonicals Check for more than one canonical element, or a tag and a header that differ One, consistent
Rendered canonical Compare served and rendered HTML Same value; a script has not changed it
Canonical on noindex or blocked pages Cross-check No canonical pointing to a page that cannot be indexed
Sitemap and canonical agreement Compare sitemap URLs with canonical values Every sitemap URL is its own canonical
Google's selection URL Inspection on samples Google-selected canonical equals the declared one

The last test is the outcome measure. A declared canonical is a signal, and URL Inspection shows which URL Google chose. Where the two differ after a migration, look for a signal still naming the old address.

Run the audit on staging before launch, again on production at launch, and again a few weeks later, when stored values and caches have had time to reveal themselves.

The canonical audit depends on knowing which old URL corresponds to which new one, and that correspondence is the redirect map, whose preparation is covered in the guide to how a redirect map should be prepared before migrating thousands of URLs.

The rule: after a migration, every statement the site makes about a preferred URL, in tags, headers, sitemaps, annotations, and links, names the new address in one consistent form.

Link trail

Reader comments on this answer

Add your comment to this answer

Your email address will not be published. Required fields are marked *