Skip to content

Is React bad for SEO?

React isn't bad for SEO. Sending empty HTML is. A React app that builds every page in the browser gives crawlers almost nothing to read, while a React site that puts each page's content in its HTML, built ahead of time or on a server, is as easy to read as any other site. Here is how to tell which one you have, and how to fix it.

By Zuzo Studio, the team behind Xodia

Published · Updated

Free plan. No card needed.

A client-only React appEmpty until JavaScript runs
<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <script type="module" crossorigin src="/assets/index-JJEmZeaK.js"></script>
    <link rel="stylesheet" crossorigin href="/assets/index-CDpwL1g1.css">
  </head>
  <body>
    <div id="root"></div>
  </body>
</html>
A site made in XodiaText and links in the HTML
<!doctype html>
<html lang="en">
  <head>
    …
    <title>Rye and Ember | Sourdough bakery and cafe on Mill Street</title>
    <meta name="description" content="Slow fermented sourdough, laminated pastry and good coffee, baked by hand every morning at 14 Mill Street. Order ahead or pull up a chair."/>
  </head>
  <body>
    <div id="root">
      …
      <main id="main">
        <script type="application/ld+json">{"@context":"https://schema.org","@type":"Bakery","name":"Rye and Ember", …}</script>
        <h1 class="…">Sourdough worth getting up early for</h1>
        <p class="…">We ferment every loaf for 36 hours, laminate our croissants by hand and pull the first bake out of a stone oven at 7 every morning. Come early for the warm ones.</p>
        <a class="btn-ember" href="/visit#order">Order ahead</a>
        <a class="btn-quiet" href="/menu">See the menu</a>
        …

The home page of our Rye and Ember template, built both ways. These are the first lines of each file as a crawler gets it, tidied for reading; … marks what is left out.

How React pages get their HTML

Three ways to render a React page

The same React components can reach a visitor in three ways. What a crawler gets depends on which one your site uses.

  • Client-side rendering

    The server sends one small HTML file with an empty root element and a script. The browser runs the script, which draws the page. This is how a new React app on Vite starts out.

    A crawler gets: a title, maybe, and an empty page until JavaScript runs.

  • Pre-rendering

    Each page's HTML is built once, when the site is built, and served as a file. In the browser it then becomes a normal React app again. It suits sites whose pages are known at build time, such as business sites, portfolios, docs and blogs.

    A crawler gets: the full page, from any static host.

  • Server rendering

    A server builds the page's HTML on each request, then the browser takes over. It suits pages that change per visitor or by the minute, at the cost of running a server.

    A crawler gets: the full page, every time.

What Google sees

What Google does with a JavaScript page

Google crawls, renders and indexes JavaScript pages in three phases. It can read a client-side rendered page, with some delay and a few conditions.

  • Googlebot fetches the HTML first and adds the links it finds there to its crawl queue.
  • Pages that answer 200 then wait in a rendering queue. Google says a page may stay there for a few seconds, but it can take longer.
  • When Google's resources allow, an up-to-date Chromium runs the JavaScript, and Google indexes the rendered page and follows its new links.
  • Some pages never get that far: a noindex tag in the first HTML or an error status can mean rendering is skipped, and Google won't run JavaScript from files that robots.txt blocks.

Beyond Google

Not every reader runs JavaScript

Google is one reader of your site among many, and it is the patient one.

Google's own guide puts it plainly: server-side rendering or pre-rendering is still a great idea, because it makes your site faster for people and crawlers, and not all bots can run JavaScript. Many search engine crawlers, AI tools that read pages to answer questions, and the apps that draw link previews in chats and social posts read the HTML and stop there.

For a client-only React app, that means a title, a few tags and an empty root element. The text, the headings, the links to other pages and often the Open Graph share tags all arrive later, with JavaScript, after these readers have gone.

Speed is the other half. With the content in the HTML, the browser can show the page before the JavaScript has loaded, which helps the first paint and Core Web Vitals on slow phones.

Step by step

How to check what search engines see

Four checks, from a quick look to Google's own answer. None of them needs code.

  1. 1

    View the page source

    Open the page in a browser and view its source, with Ctrl+U on Windows and Linux or Option+Command+U in Chrome on a Mac. This is the HTML the server sent, before JavaScript. Search it for a sentence from the page: if it isn't there, crawlers that don't run JavaScript don't see it either.

  2. 2

    Run the free SEO checker

    Paste the address into the Xodia SEO checker. It fetches the page without running JavaScript and shows the word count, title, description, headings, links and canonical in the HTML, plus whether robots.txt, sitemap.xml and llms.txt exist.

  3. 3

    Ask Google with URL Inspection

    In Google Search Console, inspect the address and press Test live URL, then View tested page. It shows the HTML after Google rendered the page and a screenshot, so you can see whether the content made it through.

  4. 4

    Check the pages that matter most

    Repeat for the home page, a key product or service page and a blog post. Client-only rendering usually affects every page the same way, so a few checks tell you about the whole site.

Or in a terminal: the first lines of the HTML
curl -s https://example.com/ | head -n 40

Check a page now

The free SEO checker reads any public page the way a crawler without JavaScript does.

Fixes

How to make a React site search engines can read

Put the content in the HTML first. Then make sure each page says what it is, links to the others and answers with the right status.

  • Pre-render at build time

    Render each route to an HTML file when you build. Vite's server rendering guide shows how to pre-render known routes, React Router can pre-render the paths you list, and React has a prerender API for this job. Rebuild when content changes.

  • Or render on a server

    A framework that renders on the server, such as React Router in framework mode or Next.js, sends full HTML on every request. Choose it when pages change per visitor or too often to rebuild.

  • A title and description per page

    Give every page its own title, meta description, canonical address and share tags, and put them in the page's HTML. Google can read a canonical set by JavaScript, but says HTML is the best place for it.

  • Real links and addresses

    Google finds pages through <a href> links. Give each view its own address with the History API, which React Router does, rather than a # fragment.

  • Real status codes

    Answer a missing page with a 404, not a 200 with an error message drawn by JavaScript. When that is hard in a client-only app, Google suggests redirecting to a page that answers 404, or adding a noindex tag.

  • A sitemap and open robots rules

    List every page in sitemap.xml and name it in robots.txt. Don't block your JavaScript or CSS files there: Google won't run JavaScript from files that robots.txt blocks.

What to avoid

Fixes that cause new problems

A few common shortcuts look like fixes but trade one problem for another.

  • A separate page for bots

    Serving crawlers a rendered copy while people get the app is called dynamic rendering. Google calls it a workaround and not a recommended solution, because it adds complexity and cost. Pre-rendering serves the same HTML to everyone.

  • noindex while loading

    A noindex tag in the first HTML that JavaScript removes later may never be removed for Google: when it sees noindex, it may skip rendering. If a page should be listed, leave noindex out of its HTML.

  • Content behind a click

    Google Search doesn't click or scroll your page, so text that loads only after a click or a scroll may never be seen. Put the page's main text in the first render.

How Xodia does it

How Xodia builds React sites

Xodia is a visual website builder for real React code on Vite. Sites made from its templates are pre-rendered: every page is built as an HTML file when the site is built, then runs as a React app in the browser.

  • Each page's title, description, share tags, structured data, headings, text and links are in its HTML, on Xodia hosting and on Vercel, Netlify or Cloudflare
  • Every published CMS item gets its own HTML page, and drafts get none
  • On Xodia hosting, the pages of every site are pre-rendered, imported React sites included
  • sitemap.xml, robots.txt and llms.txt are written on every build from Search engines settings

This website is built the same way. More detail: SEO for React sites.

Xodia's Project settings on Search engines, scrolled to the Sitemap card on Automatic: the ten addresses in sitemap.xml with the journal posts marked Journal, two drafts left out, Open sitemap.xml and Copy address.

Questions

Questions about React and SEO

Is React bad for SEO?

No. React is a way to build the page; what matters for SEO is whether the page's content is in the HTML. A client-only React app sends almost empty HTML and depends on every reader running JavaScript. A pre-rendered or server-rendered React site sends the full page, like any other website.

Can Google index a client-side rendered React app?

Usually, yes. Google renders pages with an up-to-date Chromium after they wait in a queue, then indexes the rendered page. It can take longer than reading plain HTML, and other crawlers, AI tools and link previews often don't render at all.

Do I need Next.js for SEO?

No. Server rendering is one way to put the content in the HTML. Pre-rendering at build time is another, and it works with a plain Vite and React site on any static host. Choose server rendering when pages change per visitor or too often to rebuild.

Is Vite good for SEO?

Vite builds fast, small sites, but a new Vite and React app renders in the browser only. Add a pre-render step for your routes, or use a framework on Vite that renders on the server, and Vite sites are as readable as any other.

Is pre-rendering the same as cloaking?

No. Cloaking shows search engines something different from what people see. A pre-rendered page sends the same HTML to everyone, and the browser turns it into the same page people would have seen anyway.

What about pages whose data changes?

Pre-render them and rebuild when the data changes, which suits content that changes a few times a day, such as a blog or a product list. For prices or stock that change by the minute, or pages that differ per visitor, render on a server instead.

How do I know my fix worked?

View the page source again and find your text in it, run the free SEO checker for a word count, and use URL Inspection in Google Search Console to see the page as Google rendered it. New pages can take days or weeks to show in search results.

Primary sources

Official docs

Updated

Keep exploring

See every guide

Build in React. Get found.