Skip to content

Check whether JavaScript changes a page's canonical

Save the original HTML response and the rendered document for the same URL. Compare canonical declarations with the approved target. Investigate when rendering removes or changes the intended signal.

What you need

For a technical SEO lead investigating a canonical change after a frontend release.

  • The URL, expected canonical and the release or rendering version.
  • A raw HTML response and a rendered page captured with the same host and locale.

Compare initial and rendered declarations

  1. Fetch the initial HTML and record any canonical element.
  2. Render the page and record its canonical elements after the page settles.
  3. Compare both observations with the expected URL. Give conflicting or missing results to the frontend owner.

Rendering changes the intended URL

Synthetic data. The approved target is /catalog/blue.

Scroll the table to see all columns.

Rendering changes the intended URL
ObservationCanonicalOutcome
Initial HTML/catalog/blueMatches
Rendered HTML/catalogInvestigate

The rendered canonical differs from the approved target. Save both observations and the rendering conditions.

What to hand over

Give the frontend owner the two captures, expected URL and a repeatable rendering test.

Limitation. A local render is one observation. Google may render at a different time and select its own canonical.

Next step

Bring one URL where the canonical changes after the page loads.

Discuss this workflow with Shadyy

Sources