JavaScript SEO: the complete guide
How Google crawls, renders and indexes JavaScript sites, where it breaks, how to test what a crawler sees, and which rendering approach to choose.

In short: Google can index JavaScript sites, but it does so in two passes, first the HTML it receives and then the page after a headless browser has run the scripts. Anything that only exists after the second pass is slower to be seen and easier to lose. JavaScript SEO is the work of making sure the content, links, tags and status codes that matter are present, correct and consistent in both.
How Google handles a JavaScript page
Google’s documentation describes three phases: crawling, rendering and indexing.
- Crawling. Googlebot checks robots.txt, requests the URL and reads the links in the HTML it gets. Only
<a>elements with anhrefcount as links. - Rendering. Pages that return a 200 status are queued for rendering unless a robots meta tag or header blocks indexing. A headless Chromium then runs the JavaScript. Rendering can take longer than a few seconds, and pages can wait in a queue. Google will not render JavaScript from files or pages that robots.txt blocks.
- Indexing. Google parses the rendered HTML again for content and links, and uses it for indexing.
Reported figures from a Google talk in October 2026 put the render itself at seconds and the wait in the queue at hours, with days to weeks at the slow end. They are second-hand and not official, so read the caveats in Google’s reported crawl and index timings. The practical lesson holds either way: anything you depend on JavaScript to produce arrives later than what is in the HTML.
Where JavaScript SEO breaks
| Symptom | Common cause | Fix |
|---|---|---|
| Content is missing from the indexed page | Content is fetched after a user action, or the API call fails for the crawler | Render primary content on the server or at build time, and load it without interaction |
| Pages are not discovered | Navigation uses buttons, onclick handlers or fragment URLs such as #/products |
Use real <a href> links and clean paths with the History API |
| Page is blocked from rendering | robots.txt blocks JavaScript or CSS files | Allow the files the page needs to render |
| A page is indexed that should not be | A noindex is in the raw HTML and JavaScript tries to remove it, or the reverse |
Decide indexing in the server response, not in client scripts |
| “Not found” pages are indexed | Single-page app returns 200 for every route | Return a real 404, or redirect to a URL that does, or add noindex on error views |
| Wrong canonical or title | JavaScript rewrites tags, or there are duplicates | Set tags in the initial HTML, and make sure there is only one canonical |
| Content behind scroll or click is missing | Lazy loading depends on events Google does not trigger | Load by viewport visibility, and give every content chunk its own URL |
| Stale scripts after a release | Rendering may use cached JavaScript or CSS | Fingerprint file names so changed files get new URLs |
| Slow interaction | Heavy hydration and long tasks | Reduce JavaScript on the main thread; the Core Web Vitals entry explains how interaction is measured |
These come straight from Google’s guidance on JavaScript SEO basics and fixing JavaScript problems.
Two details that catch teams out
- noindex and JavaScript. If Google sees
noindexin the initial HTML it may skip rendering, so removing it with JavaScript may never be seen. If you want the page indexed, do not shipnoindexin the source. - Status codes in single-page apps. A client-side “page not found” view with a 200 status is a soft 404. Either redirect to a server route that returns 404, or set
noindexon the error view.
The rendering options
| Approach | HTML sent first | Good for | Watch for |
|---|---|---|---|
| Client-side rendering (CSR) | An empty shell | Logged-in apps, tools | Content depends on rendering; slower first paint |
| Server-side rendering (SSR) | Full HTML per request | Pages that change often or are personalized | Server cost and response time |
| Static generation (SSG) | Full HTML built ahead | Content that changes rarely | Rebuilds when content changes |
| Incremental or on-demand regeneration | Static HTML refreshed in the background | Large catalogues | Cache and freshness rules |
| Hydration | Server HTML, then scripts attach behavior | Most modern frameworks | Mismatches and heavy scripts |
| Dynamic rendering | Different HTML for bots | Last-resort workaround | Google calls it a workaround, not a long-term solution |
Google recommends server-side rendering, static rendering or hydration over dynamic rendering. Dynamic rendering is generally not treated as cloaking when the content is similar, but it adds complexity and a second system to keep consistent. The glossary entries on JavaScript SEO and rendering explain each term, and the articles in this guide cover how to choose.
How to test what a crawler sees
- URL Inspection in Search Console. Run a live test, then open the rendered HTML and the screenshot. If the content is not in the rendered HTML, it is not indexable.
- View source versus the rendered DOM. Source is what the server sent. The Elements panel in DevTools is what the browser built. The gap between them is your JavaScript dependency.
- Turn JavaScript off. If the page shows nothing useful, so will any crawler that does not run scripts.
- Rich Results Test. It shows rendered HTML and the structured data found in it.
- Crawl twice. Crawl with and without JavaScript rendering and compare titles, canonicals, links and word counts.
- Check the network. Make sure the API calls the page needs succeed and are not blocked.
A JavaScript SEO checklist
- Primary content, headings and internal links are in the rendered HTML, and ideally the initial HTML.
- Every link is an
<a href>with a real path. Routing uses the History API, not fragments. - One title, one description and one canonical per page, set once, not rewritten.
- Indexing directives are decided on the server.
- Error and empty states return correct status codes.
- robots.txt does not block scripts, styles or the API paths the page needs.
- Lazy loading uses viewport visibility, and infinite scroll has unique URLs.
- Structured data is present in the rendered HTML and valid.
- Script file names are fingerprinted.
- Performance is measured with field data, since heavy JavaScript hurts INP and LCP.
Not only Google
Other search engines and many AI crawlers may not run JavaScript at all. Content that is only available after rendering may be invisible to them. For pages that matter, serving the content in the HTML protects you from all of them.
This sits squarely in my JavaScript SEO work work, get in touch to book a first look.
In this guide
FAQ
Can Google index JavaScript sites?
Yes. Google renders pages with a headless Chromium and indexes the rendered result. The risk is not that it cannot, but that rendering adds a step where content, links, tags or status codes can go missing or be delayed.
Is server-side rendering required for SEO?
Not strictly, but Google's documentation still recommends it because it helps users and crawlers, and not every bot runs JavaScript. For content that must be indexed reliably, serving it in the HTML is the safest design.
How do I check what Google sees on a JavaScript page?
Use the URL Inspection tool in Search Console (live test, then view the rendered HTML and screenshot), and compare the rendered HTML with the page source. The Rich Results Test shows rendered output too.
Sources
- Understand JavaScript SEO basics · Google Search Central
- Fix search-related JavaScript problems · Google Search Central
- Fix lazy-loaded website content · Google Search Central
- Dynamic rendering as a workaround · Google Search Central
- Rendering on the web · web.dev
- URL Inspection tool · Google Search Console Help
- Rich Results Test · Google
- How HTTP status codes affect Google crawlers · Google Search Central
- Block search indexing with noindex · Google Search Central
- How to specify a canonical with rel="canonical" and other methods · Google Search Central
- Google crawling, indexing and serving timing data (report of a Search Central Live talk, Oct 2026) · Search Engine Roundtable
Related glossary terms
Want this applied to your site?
Tell me about your site and I’ll suggest the next step.
Work with me Services