JavaScript SEO is the work of getting script-built content into Google’s index, where Google fetches the HTML, renders it in headless Chromium and then indexes the result.
Compare raw and rendered HTML
Paste both versions of one page. Nothing leaves your browser.
Google renders pages in a second step, so titles, canonicals, links and main content that exist only after rendering are found later, or missed when rendering fails. The checker above shows which of those fields your page leaves to JavaScript.
Read the result from the top. A red row means Google may index the wrong value or nothing at all; a yellow row means the value depends on rendering, which works for Google most of the time but costs time and fails for crawlers that do not run JavaScript. Google itself says server-side or pre-rendering is still a great idea because it makes a site faster for users and crawlers, and not all bots can run JavaScript (Google’s guide to JavaScript SEO basics).
After a fix ships, the changed URLs need a fresh crawl before Google indexes the new version. On a large app that can mean hundreds of routes at once, which is where our features for indexing projects come in: bulk lists, per-URL status and reports for each batch.
What JavaScript SEO is
JavaScript SEO covers every way a script can change what a crawler sees: content injected after load, links built by a router, titles set by a component, status codes that a single-page app cannot send, and resources a crawler is not allowed to fetch. The goal is simple: the HTML that Google indexes should contain the same title, canonical, robots rules, main text and links you see in the browser.
Two versions of every page matter. The raw HTML is the server response. The rendered HTML is the DOM after scripts have run in a browser, which for Google means its Web Rendering Service, a headless Chromium. When the two differ in the fields above, you have a JavaScript SEO question to answer.
Once a page is fixed, there are two ways to ask for a recrawl. For your own site, Search Console URL Inspection can request indexing one URL at a time. Partner pages are harder: a React app or a directory profile that links to you sits in someone else’s property, so once its owner ships the rendering fix, a Google link indexer such as ours can submit that page for a fresh crawl.
How Google crawls, renders and indexes JavaScript
Rendering is one link in the chain from discovery to ranking, and the interactive technical SEO checklist walks through the rest of that chain for a whole site. Google’s guide to JavaScript SEO basics splits the work for script-heavy pages into three phases that run in this order:
- Crawling. Googlebot fetches the URL after checking robots.txt. If a page or a script file is disallowed, Google skips it and will not render JavaScript from blocked files or on blocked pages. Run your script and style paths through a robots.txt check for Googlebot to catch such a block. Links in the raw HTML go straight into the crawl queue.
- Rendering. Every page with a 200 status is queued for rendering unless a robots meta tag or header says not to index it. Google says a page may stay in this queue for a few seconds, but it can take longer. A headless Chromium then runs the JavaScript.
- Indexing. Google parses the rendered HTML for links again and uses it to index the page. Content that is not in the rendered HTML cannot be indexed.
Two consequences follow. First, a noindex in the raw HTML can stop the process before rendering: Google says it may skip rendering when it encounters noindex, so removing the tag with JavaScript may not work. Second, rendering is not guaranteed. Google’s robots meta tag documentation notes that Google typically renders pages in order to index them, however rendering is not guaranteed. Anything critical belongs in the raw HTML.
Rendering options: CSR, SSR, static generation, dynamic rendering
The rendering approach decides how much of a page exists before JavaScript runs. The terms below follow the definitions on web.dev (Rendering on the Web) and Google’s own guidance.
| Approach | What the server sends | Crawler view | Typical use |
|---|---|---|---|
| Client-side rendering (CSR) | An app shell and scripts; the browser builds the page | Content only after rendering | Logged-in apps, dashboards |
| Server-side rendering (SSR) | Full HTML built per request, then hydrated in the browser | Content in the first response | Pages that change often and must rank |
| Static generation (pre-rendering) | Full HTML built at deploy time | Content in the first response | Docs, blogs, marketing pages |
| Hydration | Server or static HTML plus scripts that make it interactive | Content in the first response | The usual pairing with SSR or static |
| Dynamic rendering | Pre-rendered HTML to bots, the client-side app to users | Content for bots only | A workaround, no longer recommended |
Google calls dynamic rendering a workaround and not a long-term solution, and recommends server-side rendering, static rendering or hydration instead (Google Search Central, Dynamic rendering as a workaround). It is not cloaking as long as both versions show similar content, but it adds a second rendering path to maintain.
Rendering approach picker
Four questions about your site. The answer names a rendering approach and the trade-offs.
JavaScript SEO best practices
The list below follows Google’s JavaScript SEO basics, its lazy-loading guide and its link best practices. Each item is something the checker above can show you.
Titles, meta and canonicals in the initial HTML, crawlable links, status codes, History API
- Titles and descriptions. JavaScript may set or change them, but values in the raw HTML are read on the first pass and by crawlers that do not render.
- Canonical. Google says not to change the canonical with JavaScript to something other than the URL in the original HTML. If you must set it with JavaScript, leave it out of the HTML and make sure only one canonical tag exists.
- Links. Google can only reliably follow
<a>elements with anhref. Links injected by JavaScript are fine as long as they use that markup. Aspanwith a click handler or an anchor withouthrefis not a link to a crawler. - Status codes. Return 404 for missing pages and 401 for pages behind a login. In single-page apps where that is impractical, Google suggests a JavaScript redirect to a URL that returns 404, or adding a noindex robots meta tag to error views.
- History API, not fragments. Route with real paths and
history.pushState. Google cannot reliably resolve URLs that load different content after a#. - Long-lived caching. Google’s renderer may ignore caching headers and use outdated scripts; content fingerprinting in file names (for example
main.2bb85551.js) avoids that.
Navigation built from buttons and click handlers is the most common link failure in single-page apps, so our guide to crawlable links in JS apps shows the router patterns that produce real anchors.
JavaScript and Core Web Vitals
Script weight shows up in Core Web Vitals, the field metrics behind the Search Console report of the same name. web.dev sets the good thresholds at a Largest Contentful Paint within 2.5 seconds, an Interaction to Next Paint of 200 milliseconds or less and a Cumulative Layout Shift of 0.1 or less, judged at the 75th percentile of page loads (web.dev, Web Vitals).
Rendering choices move those numbers. web.dev’s rendering guide notes that the JavaScript a client-rendered app needs tends to grow with the app, which can hurt INP, and that server rendering usually gives a fast first paint with less main-thread blocking. Hydration is not free either: heavy scripts that run after the server HTML arrives can still raise blocking time and INP (web.dev, Rendering on the Web).
Structured data added with JavaScript
Google Search processes structured data that is in the DOM when it renders the page, whether a script writes all of the JSON-LD or adds to markup from the server; Google Tag Manager is one documented way to inject it (Google Search Central, Generate structured data with JavaScript). Test the live URL in the Rich Results Test rather than pasted code, which Google says runs into JavaScript limits such as CORS. For Product markup Google adds a warning: markup generated on the fly can make Shopping crawls less frequent and less reliable, so price and stock belong in the server response. The checker above flags JSON-LD that exists only after rendering.
Lazy loading and images
Lazy loading is fine when content loads as it enters the viewport. Google recommends browser-native lazy loading for images and iframes, the IntersectionObserver API, or a library that loads data when it becomes visible, and warns that Google Search does not interact with your page, so content that waits for a scroll or a click may never load (Google Search Central, Fix lazy-loaded content). Do not lazy-load content that is visible as soon as the page opens.
Lists that load more items as the user scrolls need one URL per chunk, with stable content and sequential links between the chunks. The same rules apply to paginated archives, so the pagination guide explains how to make infinite scroll indexable without losing the scrolling behaviour.
React SEO
React itself is neutral: a React app rendered only in the browser is client-side rendering, and the same components rendered on the server are SSR. Whether React is good for SEO depends on which of the two reaches the crawler. For React apps that must rank, web.dev names Next.js among the solutions for server-side rendering.
React Helmet and metadata, Next.js, routing and status codes
- Metadata in client-rendered React. React Helmet is a component that manages changes to the document head; in a client-only app those changes still appear only after rendering. Current React versions can also render
<title>and<meta>from any component and place them in the head (React documentation), but without server rendering that still happens in the browser. - Next.js. Layouts and pages are Server Components by default, and the Metadata API (a static
metadataobject or agenerateMetadatafunction) writes title and meta tags into the server response. Both exports only work in Server Components (Next.js documentation). - Routing. Use the router’s link component, which renders a real
<a href>; avoid programmatic navigation on non-link elements for anything a crawler should follow. - Status codes. A client-side router returns 200 for every path. Render real 404s on the server, or follow Google’s two fallbacks for single-page apps described above.
// Next.js App Router: metadata in the server response
export const metadata = {
title: "Blue Stoneware Mug, 350 ml",
description: "A blue stoneware mug that holds 350 ml.",
};Common JavaScript SEO issues
| Symptom | Likely cause | Fix |
|---|---|---|
| Indexed page shows a generic title | Title set only by JavaScript; first pass sees the shell title | Server render the title |
| Content missing from the index | Content loads on scroll or click, or rendering failed | Load on viewport entry; server render main content |
| Wrong canonical chosen | JavaScript changes the canonical from the HTML value | Keep one canonical, identical in raw and rendered HTML |
| Page stays out after removing noindex in JavaScript | Google skipped rendering because the raw HTML said noindex | Remove noindex from the raw HTML |
| Deep pages never discovered | Navigation uses click handlers or # routes | Real <a href> links and the History API |
| Soft 404 reports for app routes | Client router returns 200 for missing items | Server 404, or redirect to a 404 URL, or noindex the error view |
| Rendered page looks broken in URL Inspection | Scripts or CSS blocked in robots.txt, or outdated cached scripts | Allow resources; fingerprint file names |
| Web component text missing | Content inside shadow DOM not projected | Use a slot so light DOM content appears in the rendered HTML |
Auditing a JavaScript site
- Pick one URL per template: home, category, product or article, search, and an error route.
- For each, paste raw and rendered HTML into the checker above and note every red or yellow row.
- Run a live test in URL Inspection and check the rendered HTML for your main content. View tested page also shows a screenshot, the HTTP headers, JavaScript console output and the page resources that loaded.
- Crawl the site twice with a crawler that can render JavaScript: once with rendering off, once on. Compare the number of URLs found and the word count per template.
- Check robots.txt for blocked script and style paths, and the Page indexing report for soft 404s and pages crawled but not indexed.
- Fix by template, deploy, then request a recrawl of the changed URLs and compare raw and rendered HTML again.
Frequently asked questions
Does Google render JavaScript?
Yes. Google runs JavaScript with an evergreen version of Chromium and uses the rendered HTML for indexing. Rendering happens in a queue after crawling, can take longer than a few seconds, and is not guaranteed, so critical content should not depend on it. When a page renders fine but still drops out, look at the indexing decision instead; our guide to rendered pages left as crawled, currently not indexed covers that status. If you suspect the problem sits earlier, for example in robots.txt or status codes, we explain how to find crawlability and indexability issues step by step.
Is React good for SEO?
React is fine for SEO when the content reaches the crawler as HTML. A client-only React app depends on Google rendering it, and other crawlers may not run JavaScript at all. Server-side rendering or static generation, for example with Next.js, removes that dependency.
Is server-side rendering better for SEO?
For pages that must rank, server-side or static rendering is the safer choice: the title, canonical, links and main text are in the first response, so Google does not have to wait for rendering and crawlers that skip JavaScript still see them. Google recommends server-side rendering, static rendering or hydration over dynamic rendering.
How do I see the rendered HTML Google uses?
Use Search Console URL Inspection, run a live test and open View tested page, or use the Rich Results Test; Google points to both for checking the rendered HTML. Copy it into the checker above to compare it with view-source. Both tools fetch the page with a Google crawler, which raises a related question: does Google still use mobile-first indexing? Our mobile guide answers it.