JavaScript sites and Google Search: crawl, render, index
Understand how Google crawls, renders and indexes JavaScript sites and what to check when important content depends on browser code.
If your app renders content in the browser with JavaScript, Google's documentation on JavaScript SEO basics explains what happens to it. We read the whole page on 15 November 2026. The guides it links to (lazy-loading, troubleshooting, long-lived caching) were not read.
The three phases
Google processes JavaScript web apps in three phases: crawling, rendering and indexing.
- Googlebot takes a URL from the crawl queue and checks robots.txt. If the URL is disallowed, it skips the request, and Google Search will not render it.
- It parses the HTML response for links in
hrefattributes and queues them. - Pages with a
200status are queued for rendering unless a robots meta tag or header says not to index. The page may wait seconds or longer. A headless Chromium then runs the JavaScript, and Google parses the rendered HTML for links and content.
Per the page, pages with non-200 status, such as a 404, may skip rendering. In the app shell model, the first HTML has no content and Google needs rendering to see it.
Practices from the page
- Server-side or pre-rendering is called "still a great idea": faster for users and crawlers, and not all bots run JavaScript.
- Titles and descriptions can be set with JavaScript, but should be unique and descriptive. See our title-links article.
- Canonical URL: best set in HTML. If set with JavaScript, never change it to a different URL than the one in the original HTML.
- Links: JavaScript-injected links are fine if they follow crawlable-link practices.
- Status codes: use a real 404 for missing pages and 401 for login-gated ones.
- Soft 404s in single-page apps: for client-side routing, redirect with JavaScript to a URL that returns a 404 status, or add a noindex robots meta tag to error pages using JavaScript.
- Use the History API, not URL fragments, for client-side routing. Google can only discover links that are
<a>elements with anhref; the page marks#/productsstyle fragment links as bad practice and showspushStatewith real paths instead. - Robots meta with JavaScript: you can add or change it, but the page warns that when Google sees
noindexit may skip rendering, so removingnoindexwith JavaScript may not work. If you want the page indexed, do not shipnoindexin the original HTML. - Injected canonical: if you inject one, make sure it is the only canonical tag; multiple or conflicting tags may give unexpected results.
- Long-lived caching: the page says Googlebot caches aggressively and its renderer may ignore caching headers, so it may use outdated JavaScript or CSS. Content fingerprinting (a hash in the filename such as
main.2bb85551.js) avoids this. - Structured data can be generated as JSON-LD with JavaScript; test it.
- Web components: Google flattens shadow and light DOM; only content visible in the rendered HTML can be indexed. Check with the Rich Results Test or URL Inspection tool; a slot element is one way to project light DOM content.
- Images: lazy-load, following Google's lazy-loading guidelines.
- Compatibility: Google runs an evergreen Chromium, but has limits on supported APIs; the page recommends feature detection with polyfills and points to a troubleshooting guide.
Questions for your app
- Does the first HTML response contain the content, or only an app shell?
- What status does an unknown URL return?
- Is the canonical tag identical before and after JavaScript runs?
Limits
One page, read in full, but not the guides it links to. We make no claims about how long rendering takes beyond the page's wording, and none about traffic effects.
By Omnistu.