JavaScript rendering · Raw and rendered HTML

H1 changed by JavaScript

The server sends this page with one H1, then a script replaces its text with a different heading after the page loads in a browser.

How this page is built

The raw HTML has the H1 "H1 changed by JavaScript". A script at the end of this section replaces it with "A heading rewritten in the browser".

Why it matters

The H1 is a strong clue to what a page is about. When the raw and rendered versions differ, crawlers that do not render see one heading and those that do see another. Google may use either, and the mismatch makes it harder to predict how the page is understood.

Changed headings usually come from personalisation, A/B tests or front-end frameworks that rebuild the page 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 H1 text differs between the two.

How to fix it

Send the final heading in the raw HTML. If an A/B test changes headings, make sure the test is short and both versions are sensible.

Back to all tests