← Back to Blog

React vs Next.js: Why your AI-generated website is failing at SEO


React vs Next.js: Why your AI-generated website is failing at SEO

Tools like v0, Bolt.new, and Claude Artifacts are excellent for generating interface prototypes within seconds. However, if you deploy that generated code directly to production, you will likely encounter a frustrating issue down the line: Google will not index your pages properly.

Here is why client-side React breaks SEO for AI-generated websites, and how to resolve it quickly.

The Problem with Client-Side Rendering (CSR)

Most AI prompts produce single-page React applications (typically bundled with Vite or Create React App). These rely entirely on client-side rendering (CSR).

When Googlebot requests a CSR page, it receives an HTML shell:

<!DOCTYPE html>
<html>
 <head></head>
 <body>
 <div id="root"></div>
 <script src="/src/main.tsx"></script>
 </body>
</html>

Your copy, headers, images, and structured metadata are missing from that initial document. They only render after the JavaScript bundle downloads and executes within the browser.

Google can execute JavaScript, but it relies on a two-wave indexing model. It fetches the raw HTML first, places the JavaScript rendering into a secondary queue, and processes it when computing resources become available. In practice, this means your pages can remain unindexed or only partially indexed for weeks.

Quick Sanity Check: "View Page Source"

Open your site, right-click, and select View Page Source (not Inspect Element). If you do not see your page's actual text inside the HTML tags, search crawlers are not seeing it on their initial pass either.

Fix It: Move to SSR or Static Generation

To rank reliably, your server needs to deliver pre-rendered HTML containing your title tags, meta descriptions, and main content on the initial request.

Option 1: Next.js

If you want to maintain your React components as they are, migrate the project to Next.js. With App Router, components render on the server by default (SSR or SSG). Instead of serving an empty root div, your server delivers full HTML directly to Googlebot.

Option 2: Astro

For content-focused projects such as blogs, landing pages, or portfolios, Astro is usually a better fit than Next.js. It eliminates unused JavaScript by default, shipping plain HTML and CSS to the client. This provides near-perfect Core Web Vitals out of the box, which directly benefits your search rankings.

Quick 3-Step Migration Plan

1. Move components into Next.js or Astro: Copy your AI-generated React components into a Next.js App Router or Astro project structure. 2. Add dynamic metadata: Define page-specific </code> and <code dir="ltr" style="direction: ltr !important; text-align: left !important; unicode-bidi: isolate !important;"><meta name="description"></code> tags using Next.js <code dir="ltr" style="direction: ltr !important; text-align: left !important; unicode-bidi: isolate !important;">generateMetadata</code> or Astro <code dir="ltr" style="direction: ltr !important; text-align: left !important; unicode-bidi: isolate !important;"><head></code> props. 3. <strong>Submit an XML sitemap:</strong> Generate a <code dir="ltr" style="direction: ltr !important; text-align: left !important; unicode-bidi: isolate !important;">sitemap.xml</code> file and submit it via Google Search Console so crawlers can discover every route.</p> <p>---</p> <p>AI tools are incredible for prototyping UI, but they default to client-side setups that harm organic discovery. If inbound traffic matters for your application, package those components in a framework designed for rendering HTML on the server.</p> <p>Struggling to migrate your AI-generated React site to an SEO-friendly architecture? Book a free 15-minute infrastructure audit with me.</p> </div></div><div style="margin-top:3.5rem;margin-bottom:2rem;padding:2.5rem;border-radius:16px;border:1px solid hsl(var(--border));background:var(--surface, hsl(var(--card)));display:flex;flex-direction:column;gap:1rem"><p class="eyebrow" style="margin:0;color:var(--blue)">Commercial Engineering & Platform Infrastructure Advisory</p><h3 style="margin:0;font-size:1.4rem;font-weight:700;line-height:1.3">Need hands-on senior engineering to audit, scale, or stabilize your infrastructure?</h3><p style="margin:0;color:hsl(var(--muted-foreground));line-height:1.7;font-size:1rem">From bare-metal Kubernetes and immutable Talos Linux to drastically cutting cloud infrastructure bills, resolving PostgreSQL deadlocks, and architecting sovereign AI systems, I work directly with production engineering teams to deliver resilient foundations.</p><div style="display:flex;gap:1rem;flex-wrap:wrap;align-items:center;margin-top:0.5rem"><a style="display:inline-flex;align-items:center;gap:0.5rem" href="/hire" class="button">View Consulting Disciplines & Services<!-- --> <svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-arrow-down-right -rotate-90" aria-hidden="true"><path d="m7 7 10 10"></path><path d="M17 7v10H7"></path></svg></a><a style="display:inline-flex;align-items:center;gap:0.5rem" href="/pricing" class="button secondary">Pricing & Engagement Models<!-- --> <svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-arrow-right" aria-hidden="true"><path d="M5 12h14"></path><path d="m12 5 7 7-7 7"></path></svg></a><a href="https://api.whatsapp.com/send/?phone=212697720221&text=Hello%20Anas%2C%20I%20would%20like%20to%20discuss%20an%20engineering%20engagement" target="_blank" rel="noopener noreferrer" class="button" style="background:#25D366;color:#fff;border:none;display:inline-flex;align-items:center;gap:0.5rem"><span>💬</span> WhatsApp (+212 697 720 221)</a></div><div style="margin-top:1rem;padding-top:1rem;border-top:1px solid hsl(var(--border) / 0.6);display:flex;gap:0.75rem;flex-wrap:wrap;align-items:center;font-size:0.88rem"><span style="color:hsl(var(--muted-foreground));font-weight:600">Regional Hubs:</span><a style="color:var(--blue);text-decoration:underline" href="/hire/devops-casablanca" class="text-link">Casablanca · Morocco</a><span style="color:hsl(var(--muted-foreground))">•</span><a style="color:var(--blue);text-decoration:underline" href="/hire/devops-riyadh" class="text-link">Riyadh · KSA</a><span style="color:hsl(var(--muted-foreground))">•</span><a style="color:var(--blue);text-decoration:underline" href="/hire/devops-remote" class="text-link">Remote · Worldwide</a><span style="color:hsl(var(--muted-foreground))">•</span><a style="color:var(--blue);text-decoration:underline" href="/hire/self-hosted-n8n-morocco" class="text-link">Self-Hosted n8n</a><span style="color:hsl(var(--muted-foreground))">•</span><a style="color:var(--blue);text-decoration:underline" href="/hire/cloud-cost-reduction-hetzner" class="text-link">Cloud Cost Reduction</a></div></div><div class="newsletter-subscribe-box"><h3>Stay updated</h3><p>Get notified when I publish new deep-dives into DevOps, Cloud Architecture, and AI.</p><form><input type="email" placeholder="you@company.com" required="" value=""/><button type="submit" class="btn button">Subscribe</button></form></div></article></div></section></main><footer class="site-footer" data-nosnippet="true"><div class="footer-top"><div><a data-testid="link-footer-brand" href="/" class="brand"><img src="/portrait-96.webp" srcSet="/portrait-96.webp 1x, /portrait-192.webp 2x" class="brand-avatar" style="object-fit:cover" alt="Anas Rhimi" width="29" height="29"/><span>Anas Rhimi<span class="brand-dot">.</span>tech</span></a><p class="footer-note">Platform engineering for systems that matter.</p></div><div class="footer-columns"><div><span class="footer-label">Navigate</span><a data-testid="link-footer-about" href="/about">About</a> <a data-testid="link-footer-services" href="/hire">Services</a> <a data-testid="link-footer-projects" href="/projects">Projects</a> <a data-testid="link-footer-blog" href="/blog">Writing</a> <a data-testid="link-footer-pricing" href="/pricing">Pricing</a></div><div><span class="footer-label">Resources</span><a data-testid="link-footer-certifications" href="/certifications">Certifications</a> <a data-testid="link-footer-calculator" href="/tools/n8n-savings-calculator">n8n Calculator</a> <a data-testid="link-footer-scorecard" href="/tools/ai-seo-scorecard">AI SEO Scorecard</a> <a href="/llms.txt" target="_blank" rel="noreferrer" data-testid="link-footer-llms">LLMs.txt</a> <a href="/llms-full.txt" target="_blank" rel="noreferrer" data-testid="link-footer-llms-full">Knowledge Graph</a></div><div><span class="footer-label">Hubs & Services</span><a data-testid="link-footer-casablanca" href="/hire/devops-casablanca">Casablanca · MA</a> <a data-testid="link-footer-riyadh" href="/hire/devops-riyadh">Riyadh · KSA</a> <a data-testid="link-footer-remote" href="/hire/devops-remote">Remote · Global</a> <a data-testid="link-footer-n8n" href="/hire/self-hosted-n8n-morocco">Self-Hosted n8n</a> <a data-testid="link-footer-whatsapp-bot" href="/hire/chatbot-whatsapp-darija-morocco">WhatsApp Darija Bot</a> <a data-testid="link-footer-cloud-cost" href="/hire/cloud-cost-reduction-hetzner">Cloud Cost Reduction</a></div><div><span class="footer-label">GCC B2B Platforms</span><a data-testid="link-footer-gcc-leads" href="/products/gcc-b2b-leads">GCC B2B Leads Engine</a> <a data-testid="link-footer-gcc-delivery" href="/products/gcc-delivery-system">GCC Last-Mile Delivery</a></div><div><span class="footer-label">Connect</span><a href="mailto:contact@anasrhimi.tech" data-testid="link-footer-email">Email</a> <a href="https://api.whatsapp.com/send/?phone=212697720221" target="_blank" rel="noreferrer" data-testid="link-footer-whatsapp">WhatsApp (+212 697 720 221)</a> <a href="https://github.com/Mealiclay01" target="_blank" rel="noreferrer" data-testid="link-footer-github">GitHub</a> <a href="https://www.linkedin.com/in/anas-rhimi/" target="_blank" rel="noreferrer" data-testid="link-footer-linkedin">LinkedIn</a> <a data-testid="link-footer-privacy" href="/privacy">Privacy</a> <a data-testid="link-footer-terms" href="/terms">Terms</a> <a data-testid="link-footer-refund" href="/refund-policy">Refund Policy</a></div></div></div><div class="footer-bottom"><span>© <!-- -->2026<!-- --> <!-- -->Anas Rhimi<!-- -->. <!-- -->All rights reserved.</span><div style="display:inline-flex;align-items:center;gap:14px;flex-wrap:wrap"><span>Remote · Worldwide</span></div></div></footer><aside class="floating-wa-container" data-nosnippet="true" aria-label="WhatsApp live chat support" aria-hidden="true"><div class="floating-wa-btn-wrap" data-nosnippet="true"><button type="button" class="floating-wa-btn" aria-label="Chat with Anas on WhatsApp" data-testid="btn-floating-whatsapp" data-nosnippet="true"><span class="floating-wa-pulse" aria-hidden="true"></span><svg viewBox="0 0 24 24" width="32" height="32" fill="currentColor" aria-hidden="true" class=""><path d="M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.82 11.82 0 00-3.48-8.413Z"></path></svg><span class="floating-wa-badge" aria-hidden="true"></span></button><div class="floating-wa-pill" data-nosnippet="true" aria-hidden="true" role="button" tabindex="0">WhatsApp · Direct Advisory 🟢</div></div></aside> </div> <script type="application/json" id="__POST_DATA__">{"id":12,"slug":"react-vs-nextjs-seo","title":"React vs Next.js: Why your AI-generated website is failing at SEO","date":"2026-04-07","tags":[],"excerpt":"new, and Claude Artifacts are excellent for generating interface prototypes within seconds.","content":"\u003cdiv class=\"wrapper stack gap-8\" data-astro-cid-aid3sr62>\n \u003cfigure style=\"margin: 2.5rem 0; width: 100%;\">\u003cimg fetchpriority=\"high\" decoding=\"async\" height=\"630\" width=\"1200\" src=\"/assets/og/react-vs-nextjs-seo.webp\" alt=\"React vs Next.js: Why your AI-generated website is failing at SEO\" style=\"width: 100%; border-radius: 16px; object-fit: cover; border: 1px solid var(--gray-800); box-shadow: 0 10px 30px -10px rgba(0,0,0,0.7);\">\u003c/figure>\n\n \u003cdiv class=\"content\" style=\"color: var(--gray-200); line-height: 1.8; font-size: 1.1rem; width: 100%;\">\n\u003cp>Tools like v0, Bolt.new, and Claude Artifacts are excellent for generating interface prototypes within seconds. However, if you deploy that generated code directly to production, you will likely encounter a frustrating issue down the line: Google will not index your pages properly.\u003c/p>\n\u003cp>Here is why client-side React breaks SEO for AI-generated websites, and how to resolve it quickly.\u003c/p>\n\u003ch2>The Problem with Client-Side Rendering (CSR)\u003c/h2>\n\u003cp>Most AI prompts produce single-page React applications (typically bundled with Vite or Create React App). These rely entirely on client-side rendering (CSR).\u003c/p>\n\u003cp>When Googlebot requests a CSR page, it receives an HTML shell:\u003c/p>\n\u003cpre dir=\"ltr\" style=\"direction: ltr !important; text-align: left !important; unicode-bidi: isolate !important;\">\u003ccode class=\"language-html\" dir=\"ltr\" style=\"direction: ltr !important; text-align: left !important; unicode-bidi: isolate !important;\"><!DOCTYPE html>\n<html>\n <head></head>\n <body>\n <div id=\"root\"></div>\n <script src=\"/src/main.tsx\"></script>\n </body>\n</html>\u003c/code>\u003c/pre>\n\u003cp>Your copy, headers, images, and structured metadata are missing from that initial document. They only render after the JavaScript bundle downloads and executes within the browser.\u003c/p>\n\u003cp>Google \u003cem>can\u003c/em> execute JavaScript, but it relies on a two-wave indexing model. It fetches the raw HTML first, places the JavaScript rendering into a secondary queue, and processes it when computing resources become available. In practice, this means your pages can remain unindexed or only partially indexed for weeks.\u003c/p>\n\u003ch3>Quick Sanity Check: \"View Page Source\"\u003c/h3>\n\u003cp>Open your site, right-click, and select \u003cstrong>View Page Source\u003c/strong> (not Inspect Element). If you do not see your page's actual text inside the HTML tags, search crawlers are not seeing it on their initial pass either.\u003c/p>\n\u003ch2>Fix It: Move to SSR or Static Generation\u003c/h2>\n\u003cp>To rank reliably, your server needs to deliver pre-rendered HTML containing your title tags, meta descriptions, and main content on the initial request.\u003c/p>\n\u003ch3>Option 1: Next.js\u003c/h3>\n\u003cp>If you want to maintain your React components as they are, migrate the project to Next.js. With App Router, components render on the server by default (SSR or SSG). Instead of serving an empty root \u003ccode dir=\"ltr\" style=\"direction: ltr !important; text-align: left !important; unicode-bidi: isolate !important;\">div\u003c/code>, your server delivers full HTML directly to Googlebot.\u003c/p>\n\u003ch3>Option 2: Astro\u003c/h3>\n\u003cp>For content-focused projects such as blogs, landing pages, or portfolios, Astro is usually a better fit than Next.js. It eliminates unused JavaScript by default, shipping plain HTML and CSS to the client. This provides near-perfect Core Web Vitals out of the box, which directly benefits your search rankings.\u003c/p>\n\u003ch2>Quick 3-Step Migration Plan\u003c/h2>\n\u003cp>1. \u003cstrong>Move components into Next.js or Astro:\u003c/strong> Copy your AI-generated React components into a Next.js App Router or Astro project structure.\n2. \u003cstrong>Add dynamic metadata:\u003c/strong> Define page-specific \u003ccode dir=\"ltr\" style=\"direction: ltr !important; text-align: left !important; unicode-bidi: isolate !important;\">\u003ctitle>\u003c/code> and \u003ccode dir=\"ltr\" style=\"direction: ltr !important; text-align: left !important; unicode-bidi: isolate !important;\">\u003cmeta name=\"description\">\u003c/code> tags using Next.js \u003ccode dir=\"ltr\" style=\"direction: ltr !important; text-align: left !important; unicode-bidi: isolate !important;\">generateMetadata\u003c/code> or Astro \u003ccode dir=\"ltr\" style=\"direction: ltr !important; text-align: left !important; unicode-bidi: isolate !important;\">\u003chead>\u003c/code> props.\n3. \u003cstrong>Submit an XML sitemap:\u003c/strong> Generate a \u003ccode dir=\"ltr\" style=\"direction: ltr !important; text-align: left !important; unicode-bidi: isolate !important;\">sitemap.xml\u003c/code> file and submit it via Google Search Console so crawlers can discover every route.\u003c/p>\n\u003cp>---\u003c/p>\n\u003cp>AI tools are incredible for prototyping UI, but they default to client-side setups that harm organic discovery. If inbound traffic matters for your application, package those components in a framework designed for rendering HTML on the server.\u003c/p>\n\u003cp>Struggling to migrate your AI-generated React site to an SEO-friendly architecture? Book a free 15-minute infrastructure audit with me.\u003c/p>\n\n\n\u003c/div>","_locale":"en"}</script> </body> </html>