JavaScript rendering · Raw and rendered HTML

Canonical only in the rendered HTML

The raw HTML of this page has no canonical. A script adds a self-referencing canonical after load, so only crawlers that render the page see it.

How this page is built

The canonical block is empty in the raw HTML. A script in the head creates a self-referencing canonical and adds it to the head. A crawler that reads only the raw HTML reports the canonical as missing, which is the same fault seen without rendering.

Why it matters

Google processes the raw HTML first and renders the page later, sometimes much later. A canonical that exists only after rendering may be missed in the first pass or picked up late. Other search engines and many crawl tools do not render at all, so they never see it.

This is common on sites built with front-end frameworks, where every head tag is set in the browser.

How to check it

Compare the raw HTML (view source) with the rendered HTML (the Elements panel in developer tools, or the URL Inspection tool in Search Console). Crawl tools that render JavaScript can store both versions and report differences between them. Here, the raw HTML has no canonical and the rendered HTML has one.

How to fix it

Put the canonical in the HTML the server sends. With a front-end framework, use server-side rendering or pre-rendering so that head tags are in the first response.

Back to all tests