DEV Community

Abdullah Razzaq
Abdullah Razzaq

Posted on

React or Next.js Site Not Indexed by Google? Here's the Fix

Your React app looks perfect in the browser. Google sees an empty page.
No rankings, no traffic, and Search Console just says "Crawled, currently not indexed" without telling you why.
Here's how to see exactly what Google sees in 2 minutes, find the real cause and fix it with code tested on Next.js 16.4.

Why is Google not indexing my React or Next.js site?

Almost always, it's one of three problems:
Rendering: your content only appears after JavaScript runs.
Discovery: Google can't find your URLs (no real links, /#/ routes, no sitemap).
Signals: canonicals, redirects, a stray noindex or wrong status codes point Google away.
If everything is technically fine and Google still says no, skip to the content section near the end.

How can I see what Google actually sees on my page?

Open View Source (not Inspect) or run a Live Test in Search Console's URL Inspection tool. If your main heading and text aren't in that HTML, Google may not be seeing them either.

  1. View Source, not Inspect. Press Ctrl+U (Cmd+Option+U on Mac) and search for a sentence from your page. Inspect shows the page after JavaScript runs; View Source shows the raw HTML Google receives first.
  2. Check from the terminal:
# Is your content in the raw HTML?
curl -s -A "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)" \
  https://yoursite.com/your-page | grep -i "your main heading"

# Which status codes, redirects and robots headers does Google get?
curl -sIL https://yoursite.com/your-page | grep -iE "^HTTP|^location|x-robots-tag"
Enter fullscreen mode Exit fullscreen mode
  1. Use URL Inspection's Live Test. In Search Console, click Test Live URL, then View Tested Page, and check the HTML and Screenshot tabs. Content missing from the raw HTML? Start with rendering. Otherwise, skip to discovery and signals.

What does my Search Console indexing status actually mean?

Each status points to a different cause, so find yours (under Indexing > Pages) before changing any code.
Discovered, currently not indexed: known but not crawled yet. Weak internal links, no sitemap or low priority.
Crawled, currently not indexed: fetched, then rejected. Empty or thin HTML, near-duplicates or low quality.
Duplicate without user-selected canonical: several URLs show the same content and none declares a canonical.
Page with redirect: fine if intentional; a problem if your links or sitemap still point to it.
Soft 404: the page returns 200 but looks empty or like an error.
Excluded by 'noindex' tag: noindex is in the HTML or the X-Robots-Tag header.

Can Google index a client-side React app?

Yes, but Google must render your JavaScript in a separate step first, which adds delay and more ways to fail than serving ready-made HTML.
A Create React App or Vite app sends crawlers an empty <div id="root"></div> and a script tag. Google crawls that shell, then queues the page for rendering in headless Chrome. Only then does it see your content.

Did you know? In a study of over 100,000 Googlebot fetches, Google fully rendered 100% of HTML pages. But while the median delay between crawling and rendering was 10 seconds, 10% of pages waited about 3 hours or more, and 1% waited about 18 hours.
Source: Vercel and MERJ, "How Google handles JavaScript throughout the indexing process" (2024)
Vercel builds Next.js and used nextjs.org data, so treat this as strong evidence, not the final word. The lesson holds: if rendering fails (a blocked API, a script error), Google indexes the empty shell.

Isn't Next.js SEO-friendly by default?

Only when content is rendered on the server. A 'use client' page that fetches data in useEffect sends Google the same empty HTML as a plain React app.

// app/products/[slug]/page.tsx  (bad)
'use client';
// ...
useEffect(() => {
  fetch(`/api/products/${slug}`).then((res) => res.json()).then(setProduct);
}, [slug]);

if (!product) return <p>Loading...</p>;
Enter fullscreen mode Exit fullscreen mode

When we built this page on Next.js 16.4, the server HTML contained <p>Loading...</p> and no product. Fetch the data in a Server Component instead:

// app/products/[slug]/page.tsx  (good)
import { notFound } from 'next/navigation';
import { getProduct } from '@/lib/products';

type Props = { params: Promise<{ slug: string }> };

export default async function ProductPage({ params }: Props) {
  const { slug } = await params;
  const product = await getProduct(slug);

  if (!product) notFound();

  return <main><h1>{product.name}</h1><p>{product.description}</p></main>;
}
Enter fullscreen mode Exit fullscreen mode

Now the content is in the HTML from the first byte. Keep interactive parts in small client components inside the server page.

Why are my titles and meta descriptions not showing in Google?

If JavaScript sets them after load, Google can see the same default title everywhere and treat pages as duplicates. Replace react-helmet or document.title with the Metadata API:

// app/blog/[slug]/page.tsx
import type { Metadata } from 'next';
import { getPost } from '@/lib/posts';

type Props = { params: Promise<{ slug: string }> };

export async function generateMetadata({ params }: Props): Promise<Metadata> {
  const { slug } = await params;
  const post = await getPost(slug);
  if (!post) return {};

  return {
    title: post.title,
    description: post.excerpt,
    alternates: { canonical: `/blog/${slug}` },
  };
}
Enter fullscreen mode Exit fullscreen mode

This only works in Server Components. Recent Next.js versions may stream metadata to Googlebot on dynamic pages, so confirm your title in URL Inspection.

Can ChatGPT and other AI tools see my React content?

Mostly no, because most AI crawlers read only the raw HTML.

Did you know? GPTBot, ChatGPT-User, OAI-SearchBot, ClaudeBot and PerplexityBot don't execute JavaScript. If your content only appears after React runs, these AI assistants likely can't see it. Google's Gemini is the exception, because it uses Googlebot's rendering. (Data from December 2024.)
Source: Vercel and MERJ, "The rise of the AI crawler"

How does Google find the pages on my React site?

Through real <a href> links, your sitemap and external links. Google follows href attributes; it doesn't click buttons.

// Bad: no link in the HTML
<button onClick={() => router.push('/pricing')}>Pricing</button>

// Good: renders <a href="/pricing">
<Link href="/pricing">Pricing</Link>
Enter fullscreen mode Exit fullscreen mode

Drop hash routes. To Google, /#/pricing is just /. Switch from HashRouter to BrowserRouter and serve index.html for every route.
Generate a sitemap. In the App Router, app/sitemap.ts is served at /sitemap.xml:

// app/sitemap.ts
import type { MetadataRoute } from 'next';
import { getAllPosts } from '@/lib/posts';

const BASE_URL = 'https://www.yoursite.com';

export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
  const posts = await getAllPosts();

  return [
    { url: BASE_URL, lastModified: new Date() },
    { url: `${BASE_URL}/pricing`, lastModified: new Date() },
    ...posts.map((post) => ({
      url: `${BASE_URL}/blog/${post.slug}`,
      lastModified: post.updatedAt,
    })),
  ];
}
Enter fullscreen mode Exit fullscreen mode

List only final 200 URLs, submit the sitemap in Search Console, and link every important page from at least one other page.
Don't block rendering in robots.txt. Blocking /_next/static/, CSS or the API routes your pages call stops Google from rendering them. Generate the file with app/robots.ts and disallow only private areas like /admin/.

Why does Google say "Duplicate without user-selected canonical"?

Several URLs show the same content with no clear canonical, so Google picked one itself.
It's common. According to the HTTP Archive's 2025 Web Almanac, about 1 in 3 pages has no canonical tag, and on roughly 3% of pages JavaScript changes the canonical after rendering, sending Google two conflicting signals.
Typical sources: http vs https, www vs non-www, /page vs /page/, tracking parameters, an indexable staging domain, and the sneakiest one, a canonical in the root layout. Layout metadata is inherited by every page. We tested it: with alternates: { canonical: '/' } in the layout, an /about page with no canonical of its own output <link rel="canonical" href="https://www.yoursite.com"/>, telling Google it's a copy of the homepage.
Set metadataBase in the layout and the canonical per page:

import type { Metadata } from 'next';

// app/layout.tsx: base URL only, no canonical
export const metadata: Metadata = {
  metadataBase: new URL('https://www.yoursite.com'),
};

// app/pricing/page.tsx: each page declares its own
export const metadata: Metadata = {
  title: 'Pricing',
  alternates: { canonical: '/pricing' },
};
Enter fullscreen mode Exit fullscreen mode

Keep your canonical, sitemap and internal links on the exact same URL.

Do redirects stop my pages from being indexed?

A permanently redirected URL is supposed to leave the index. The problem is links, sitemaps or canonicals pointing at redirecting URLs.
What Next.js sends (we confirmed each with curl -sI):
redirect() sends 307 (temporary)
permanentRedirect() sends 308 (permanent)
redirects() in next.config sends 308 with permanent: true, or 307 with permanent: false
A trailing slash mismatch (/pricing/ to /pricing) sends 308 (permanent)
Use one trailing-slash style everywhere, collapse redirect chains into one hop, and test locale or auth redirects in proxy.ts (called middleware.ts before Next.js 16).

Why is my Next.js page marked "noindex" or "Soft 404"?

Usually a staging noindex leaked into production, or missing pages return 200 instead of a real 404.
Leftover noindex. Tie it to the environment so it can't leak:

// app/layout.tsx
import type { Metadata } from 'next';

// VERCEL_ENV is set by Vercel. On other hosts, use your own env variable.
const isProduction = process.env.VERCEL_ENV === 'production';

export const metadata: Metadata = {
  metadataBase: new URL('https://www.yoursite.com'),
  robots: isProduction ? { index: true, follow: true } : { index: false, follow: false },
};
Enter fullscreen mode Exit fullscreen mode

Also check for an X-Robots-Tag: noindex header.
You also can't remove a noindex with JavaScript. Google doesn't render pages whose initial HTML contains noindex, so the removal script never runs (Vercel and MERJ, 2024).
Soft 404s. A single-page app returns 200 and the same index.html for every URL, even fake ones. In Next.js, call notFound() when data doesn't exist (as in the product example) and add app/not-found.tsx. In our test, a missing slug returned a real 404. If streaming has already started (for example, with loading.tsx), the status stays 200 but Next.js adds a noindex tag.
For a plain React SPA, return a real 404 for unknown routes, or follow Google's SPA guidance and add a noindex meta tag with JavaScript on your not-found view. Adding works; removing doesn't.

What's the best way to fix SEO on an existing React app?

Server rendering through Next.js or Astro is the long-term fix. Prerendering can bridge the gap if you can't migrate yet.
Server rendering (Next.js, Remix, Astro): best for sites where search traffic matters. It's a migration, but it fixes everything at once.
Build-time prerendering: good for small sites with fixed pages, but it misses pages built from live data.
Prerendering service: a stopgap for large apps that can't migrate yet. It adds cost, and bots must see the same content as users.
Google's own documentation says dynamic rendering "is a workaround and not a recommended solution" and recommends server-side rendering, static rendering or hydration instead. Migrate the pages that earn search traffic first; logged-in dashboards can stay client-side.

What should I check before requesting indexing?

The page returns 200, has its content, title and own canonical in the raw HTML, is in your sitemap and is linked from another page. Check each important URL:
curl -sIL shows one 200 with no redirect hops.
Your heading and body text appear in View Source.
A unique title and description are in the raw HTML.
The canonical matches this exact URL.
No noindex in the HTML or headers, and robots.txt allows the page and its assets.
The URL is in your submitted sitemap and linked with a real <a href>.
URL Inspection's Live Test shows your content.
Then click Request Indexing once; repeating it doesn't help.

What if my site is technically fine but still not indexed?

Then it's usually content, not code: thin pages, near-duplicates or a new domain Google doesn't trust yet. Merge thin pages, add original information, link from your strongest pages and earn a few external links. Indexing can take days to weeks, and nothing guarantees it.

The short version

Check the raw HTML, match your Search Console status to its cause, then fix rendering, discovery and signals. Server-render what matters, use real links and a sitemap, and keep one canonical URL per page.

Written by the Cyber Ghost Solutions team. We build and optimize websites for UK businesses, with a focus on technical SEO and indexing.
Last updated: November 2026. Code tested on Next.js 16.4 with the App Router.

Sources
How Google handles JavaScript throughout the indexing process, Vercel and MERJ (2024)
The rise of the AI crawler, Vercel and MERJ (December 2024)
Web Almanac 2025: SEO chapter, HTTP Archive
Dynamic rendering as a workaround, Google Search Central

Top comments (0)