Field notes Field note 09
React site not indexed? Why Google skips your pages
Why Google isn't indexing your React, Lovable or Bolt site: empty first HTML, client routing, soft 404s and canonicals, and how to check each one.
· 9 min read
A React site is usually not indexed for one of a short list of reasons: the first HTML is an empty shell, the links are not real links, the routes have no real URLs, missing pages return a 200 status, or a tag in the page tells Google the wrong thing. Google can run JavaScript, so React alone is rarely the whole story, and each cause can be checked in minutes.
It matters because a page that is not indexed cannot bring in anyone from search, however good the content is. Match your symptom to a cause in the table, then use that section's test and fix. It applies to hand-written React, Vite, and sites exported from AI builders. For builder specifics, see Lovable SEO and Bolt SEO.
Checked on 2026-11-04 against: Google JavaScript SEO docs, Google link best practices, Search Console URL Inspection and Page indexing report help, Google sitemaps docs, view-source, curl.
Symptoms, likely causes and how to test
Match what you see to a row, then read that section.
| Symptom | Likely cause | How to test |
|---|---|---|
| View-source shows an empty root div and no text | Empty initial HTML (client-side rendering) | view-source, then URL Inspection live test |
| Only the home page is indexed | Links are not <a href>, or routes are not real URLs | Search the source for <a href; check the address bar on navigation |
URLs contain #/ | Hash routing | Look at the URL after clicking a link |
| Deleted or typo URLs appear in Page indexing as "Soft 404" | Missing routes return status 200 | curl -I on a made-up URL |
| "Duplicate without user-selected canonical", or Google picks the home page | Canonical injected by JS or pointing to home | Compare view-source with the rendered HTML |
| Page is excluded by "noindex" but you removed it in code | noindex in the initial HTML | view-source, search for robots |
| Rendered screenshot is blank or broken | JS or CSS blocked in robots.txt, or a script error | URL Inspection, View tested page |
| New pages are never found | Missing sitemap or no internal links | Check /sitemap.xml and Search Console Sitemaps |
| "Discovered, currently not indexed" or "Crawled, currently not indexed" | Google found or fetched the URL and chose not to index it yet | Page indexing report |
Cause 1: the initial HTML is empty
If view-source shows only <div id="root"></div> and a script tag, the content exists only after JavaScript runs.
Google's JavaScript SEO basics say pages in the app shell model, where the initial HTML has no content, are queued for rendering. The page "may stay on this queue for a few seconds, but it can take longer than that." Google does render JavaScript, so this does not mean the page cannot be indexed. It means the content depends on a second step that can be slow or fail. Google also says that "not all bots can run JavaScript", which matters for link previews and many AI crawlers.
Test: press Ctrl+U (Cmd+Option+U on Mac) and search for a body sentence and your <h1>. The dev tools Elements panel does not count: it shows the page after JavaScript ran.
Fix: put the content in the HTML the server sends. See "Fixes" below. After the fix, the same view-source check should show your <h1> and body text instead of the root div alone.
Cause 2: links that are not real links
According to Google's link best practices, it follows links only when they are <a> elements with an href attribute. Links built from script events, such as <a onclick="goto(...)"> or a <span> with a click handler, may not be parsed reliably.
In React this is usually a <button onClick={() => navigate("/pricing")}> used as navigation, or a clickable <div> card. A rendered <a href="/pricing"> that also handles the click for routing is fine.
Test: inspect your menu and cards. Each destination should be an <a> with a real href.
Fix: use your router's link component (it renders an anchor) for navigation, and plain <a href> elsewhere.
Cause 3: no real URLs, or hash URLs
Each page you want indexed needs its own URL. Google's JavaScript guidance says to use the History API for client-side routing, and not to "use fragments to load different page content", because Googlebot cannot reliably parse them (JavaScript SEO basics). A URL like example.com/#/pricing is a fragment.
Also, if someone opens example.com/pricing directly, the server must return the app, not an error. On static hosts, single page apps often need a rewrite rule for that.
Test: click through the site and watch the address bar, then paste a deep URL into a new tab.
Fix: switch from a hash router to a browser (History API) router, and make sure every route resolves on the server.
Cause 4: missing pages return 200 (soft 404s)
A single page app often serves the same shell, with status 200, for any URL, even ones that do not exist. Google's Page indexing help describes a soft 404 as a page that "returns a user-friendly 'not found' message but not a 404 HTTP response code" (Page indexing report). The fix is a real 404 for pages that do not exist.
For client-rendered apps, Google's JavaScript guidance offers two options: use a JavaScript redirect to a URL for which the server responds with a 404 (for example /not-found), or add <meta name="robots" content="noindex"> to error pages with JavaScript (JavaScript SEO basics).
Test: curl -I https://yoursite.com/this-page-does-not-exist. A 200 means missing routes are served as pages.
Fix: return a real 404 status where your server or host allows it; otherwise use one of Google's two options.
Cause 5: canonical injected by JavaScript or pointing to home
A canonical tag tells Google which URL is the main one. A common bug is one canonical, set in index.html, pointing to the home page on every route, so every other page looks like a duplicate of the home page.
Google says you can set the canonical with JavaScript, but "the best way to set the canonical URL is to use HTML", and that JavaScript should not change a canonical to a value different from the one in the original HTML (JavaScript SEO basics). Keep one canonical tag per page.
Test: compare the rel="canonical" in view-source with the one in URL Inspection's rendered HTML, on a page that is not the home page. In the Page indexing report, look for "Duplicate without user-selected canonical": Google treats the page as a duplicate with no preferred canonical, and has chosen another page instead.
Fix: output a self-referencing canonical per route, in the HTML.
Cause 6: noindex in the initial HTML, removed by JavaScript
Some templates ship noindex in the HTML and remove it once the app loads. Google says that when it encounters noindex, it "may skip rendering and JavaScript execution", so using JavaScript to change or remove the tag may not work (JavaScript SEO basics).
Test: search view-source for noindex. If it is there, treat it as in effect.
Fix: remove it from the HTML itself, at build or on the server.
Cause 7: JavaScript or CSS blocked in robots.txt
Google's documentation says Google Search "won't render JavaScript from blocked files or on blocked pages" (JavaScript SEO basics). If robots.txt disallows your script or /assets/ paths, the rendered page can be empty.
Test: look in /robots.txt for Disallow rules covering script and style files. In URL Inspection, run the live test, open View tested page, and check the screenshot and the resources that failed to load.
Fix: allow the files the page needs to render.
Cause 8: no sitemap, and weak internal links
Google says that if your pages are properly linked, it "can usually discover most of your site", and that a sitemap can improve crawling of larger or more complex sites. It also says a sitemap "doesn't guarantee that all the items in your sitemap will be crawled and indexed" (sitemaps overview).
Test: check that /sitemap.xml lists real, final URLs and is submitted under Sitemaps in Search Console.
Fix: generate a sitemap at build time and reference it in robots.txt.
Cause 9: "Discovered" or "Crawled, currently not indexed"
These Page indexing statuses differ:
- Discovered, currently not indexed: per Google's definition, Google found the URL but has not crawled it yet. Google says it may have postponed the crawl to avoid overloading the site.
- Crawled, currently not indexed: Google crawled the page and chose not to index it. Google does not index every page it crawls, and this is not necessarily a problem.
These are symptoms, not causes. On a client-rendered site, "Crawled" can point back to Cause 1, 5 or 7: what Google rendered was thin. Neither status proves a React fault. Confirm the page renders with its content, then improve the page and its internal links.
Test: Search Console, Pages (Page indexing), open the status, pick a URL, and run URL Inspection. Use Test live URL, then View tested page.
How to check one page, end to end
- view-source: is the body text in the raw HTML?
- URL Inspection, View crawled page: what HTML did Google store?
- URL Inspection, Test live URL, View tested page: does the rendered HTML and screenshot show the content?
- **
curl -Ion a made-up URL:** is it a real 404? - Page indexing report: which status is each URL in?
A healthy result in step 3 is rendered HTML that contains your <h1> and body text, and a screenshot that looks like the real page. A blank screenshot or an HTML tab with only the root div means Google is not seeing your content.
Fixes: SSR, SSG and prerendering
Google says server-side or pre-rendering "is still a great idea" because it makes a site faster for users and crawlers (JavaScript SEO basics). In every tool, the goal is HTML that arrives with the content in it.
- Server-side rendering (SSR): the server builds each page on request.
- Static site generation (SSG) or prerendering: each page is built into an HTML file at deploy time, which suits marketing pages and blogs.
Options:
- Next.js supports server rendering and static generation for React.
- Astro renders to static HTML by default and can use React components where needed.
- Vite with a prerender or SSG plugin keeps your current setup and generates HTML per route at build.
- Remix or React Router in framework mode offers server rendering and prerendering for React Router apps.
Prerendering is the smallest change, but works only for pages whose content is known at build. A framework move is bigger and fits sites that need server logic per request. A common split is to keep the logged-in app as a single page app and put the public pages in an SSR or SSG framework. If you keep a single page app, set up GA4 tracking on route changes.
Moving a site also changes URLs and hosting, so read the website migration SEO checklist first.
No fix guarantees indexing or rankings. These remove barriers; content, links and demand still decide where you appear.
When to get help
If the checks show an empty first response and you do not want to rebuild the site yourself, making React and AI-built sites indexable is the work we do. For a first read on what crawlers receive from your URL, run the free Site Scanner.
Checklist
- view-source shows the
<h1>and body text - Every navigation is an
<a href>to a real URL, no hash routes - Deep URLs load directly
- Missing pages return a real 404
- One self-referencing canonical per page, in the HTML
- No
noindexin the initial HTML on pages you want indexed - robots.txt does not block scripts or styles
- Sitemap lists final URLs and is submitted in Search Console
- URL Inspection live test shows the content