# SEO for Lovable, Bolt, v0 & React SPA apps

Apps generated by Lovable, Bolt, Replit and Vite + React look finished in a browser, yet ship `<div id="root"></div>` with zero words in the raw HTML, identical `<title>` tags on every route, and `200 OK` soft-404s. AI crawlers (`GPTBot`, `ClaudeBot`, `PerplexityBot`) do not execute JavaScript, so they see a blank page.

- Install skills: `npx skills add subinternal/clickd`
- Ask your agent: "Run clickd_check (kind: "agent") and clickd_brief on our deployed app, show why crawlers see an empty #root shell, add build-time prerendering and per-route metadata, and rescan."
- MCP tools used: `clickd_check`, `clickd_brief`, `clickd_schema_create`, `clickd_rescan`

## What breaks most often on Lovable, Bolt & SPAs

- **Empty <div id="root"></div> HTML shell** (`content-in-html`): Client-only Vite + React SPAs send zero words before JavaScript runs, making every route unreadable to non-JS AI crawlers.
- **One static index.html title for every URL** (`title`): Updating `document.title` inside React only happens after client JS runs; link previews and non-JS bots see the default `Vite + React` or home title everywhere.
- **SPA catch-all soft 404s & missing sitemap** (`sitemap`): Rewriting `/* -> /index.html` returns HTTP `200` on nonexistent URLs and ships without `robots.txt`, `sitemap.xml` or `/llms.txt`.

## The Lovable, Bolt & SPAs agentic SEO loop

1. **Prove the blank-HTML bug** (`clickd_check`): Run clickd_check (kind: "agent") on your live URL so you and your agent see the exact empty HTML shell AI crawlers receive.
2. **Prerender or SSR public routes** (`technical-seo`): Add static route prerendering at build time (or migrate public marketing routes to Next.js / Astro / React Router SSR) so HTML contains every heading and paragraph.
3. **Emit per-route <head> & JSON-LD** (`schema-markup`): Render unique `<title>`, `<meta name="description">`, `<link rel="canonical">`, Open Graph tags and JSON-LD into each prerendered route’s `<head>`.
4. **Add sitemap.xml, robots.txt & rescan** (`clickd_rescan`): Generate `public/sitemap.xml`, `public/robots.txt` and `public/llms.txt` at build time, deploy, and run clickd_rescan to confirm a passing score.

## Worked pattern (What non-JS AI crawlers read before and after prerendering)

clickd_check (kind: "agent") compares raw HTTP HTML against your intended page copy.

```
<!-- BEFORE: Default Vite / Lovable / Bolt SPA response -->
<body>
  <div id="root"></div>
  <script type="module" src="/src/main.tsx"></script>
</body>

<!-- AFTER: Prerendered / SSR marketing route -->
<body>
  <main>
    <h1>Automated invoice reconciliation for construction</h1>
    <p>Match supplier invoices against quoted unit prices in 30 seconds...</p>
  </main>
</body>
```

## Prompts to run on Lovable, Bolt & SPAs

- **Diagnose invisible Lovable / Bolt site**: "Run clickd_check (kind: "agent") and clickd_brief on example.com, list every route returning an empty #root shell, and add build-time prerendering for our public pages."
- **Fix link previews & per-page titles**: "Ensure every public route outputs its own static <title>, meta description, canonical and og:image in raw HTML before JavaScript runs, then test live with clickd."
- **Add sitemap, robots.txt & AI visibility**: "Generate sitemap.xml, robots.txt (allowing OAI-SearchBot, ClaudeBot and PerplexityBot) and llms.txt from our router, deploy, and rescan with clickd."

## Paired skills

- [Technical SEO](https://clickd.com/skills/technical-seo): Audits and fixes crawlability, indexing, robots.txt, XML sitemaps, canonicals, redirect chains, server-rendered HTML and security headers in your site’s codebase, then checks every fix live with clickd.
- [AI visibility](https://clickd.com/skills/ai-visibility): Audits and fixes your site’s visibility in ChatGPT, Claude, Perplexity and Google AI Overviews: AI crawler access, non-JS HTML readability, answer-first passages, entity sameAs schema and live citation tracking.
- [On-page SEO](https://clickd.com/skills/on-page-seo): Rewrites title tags, meta descriptions, single H1s, question headings, answer-first openings, image alt text and AI writing tells in your site’s templates and content files, checked live with clickd.
- [Schema markup](https://clickd.com/skills/schema-markup): Generates, wires and validates JSON-LD structured data (Organization, LocalBusiness, Product, Service, Article, FAQPage and BreadcrumbList) from the visible facts on your pages, checked live with clickd.

## Questions

### Can Google index a client-rendered React SPA without prerendering?

Googlebot eventually renders JavaScript in a second wave, though client-only SPAs suffer delayed indexing, missed meta tags on link previews, and soft-404 bugs. Worse, major AI assistants (`GPTBot`, `ClaudeBot`, `PerplexityBot`) do not run client JavaScript at all, so an unprerendered SPA is invisible to AI search.

### Do we need to rewrite our entire authenticated dashboard to fix SEO?

No. Keep your signed-in app (`/app/*` or `app.example.com`) as a client SPA, and prerender or server-render only your public marketing, pricing, docs and guide routes (`/`, `/pricing`, `/guides/*`).
