Crawlable HTML in an Inertia SPA: what I changed for SEO and answer engines
Crawlable HTML in an Inertia SPA: what I changed for SEO and answer engines
Single-page apps trade developer joy for crawler pain. Inertia sits in the middle: server routes, client navigation. That does not automatically mean Google and ChatGPT see your article text.
This post explains the pattern I implemented on Aviwebsquad and how it supports SEO and AEO (Answer Engine Optimization).
The problem
On a classic Inertia page:
- The server returns a shell with a JSON page object
- JavaScript renders the article client-side
- Some crawlers index only the shell
For a monetized technical blog, "shell-only" indexing triggers low value content warnings—you look empty even when the SPA is rich.
The fix: server-rendered fallback HTML
I render a Blade partial into crawlableHtml and include it in the layout before the Inertia root:
<main id="inertia-static-fallback" class="prose">
<!-- article HTML from server -->
</main>
Controllers build that HTML from the same canonical content readers get after hydration:
- Homepage: mission, FAQ, internal links
- Blog posts: title + rendered markdown HTML
- CMS pages: title + body HTML
Humans with JS still get the Svelte UI; bots get readable text immediately.
AEO: why answer engines care
Answer engines (Google AI Overviews, Perplexity, ChatGPT browsing) reward:
- Clear question headings ("Is Aviwebsquad an agency?")
- Direct answers in plain sentences under each heading
- Structured data (JSON-LD) matching visible text
- Consistent facts across pages (author, site purpose, policies)
Fallback HTML is step one. Step two is FAQ and Article schema aligned with visible copy—no hidden keyword stuffing.
Checklist I use before publishing
- View source: is article text present before
type="module"scripts? -
meta descriptionmatches the intro paragraph - Canonical URL set on listings and posts
- Internal links to about, contact, and related posts
- Category pages have a paragraph explaining scope
- Contact page explains who responds and when
What not to do
- Do not cloak different text for bots vs users
- Do not inject thousands of words only in
noscripttags - Do not publish duplicate categories or thin tag pages
- Do not rely on client-only rendering for primary content
Measuring success
Watch:
- Indexed pages in Search Console
- "Crawled currently not indexed" reasons
- Referrals from AI search tools (where analytics allows)
- AdSense policy status after substantive fixes + time
Bottom line
Inertia does not free you from HTML semantics. Treat server fallback HTML + structured data + substantive copy as part of the framework choice—not an SEO afterthought.
That is the AEO baseline: make answers easy to extract because they are already written clearly on the page.