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
- Fetch the initial HTML and record any canonical element.
- Render the page and record its canonical elements after the page settles.
- 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.
| Observation | Canonical | Outcome |
|---|---|---|
| Initial HTML | /catalog/blue | Matches |
| Rendered HTML | /catalog | Investigate |
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.
Related guides
Sources
- Google guidance on JavaScript and search (accessed 23 November 2026)
- Google guidance on canonical URLs (accessed 23 November 2026)