JavaScript SEO: can search engines and AI actually read your site?

Open your homepage in a browser and it looks fine. But a lot of bots never see that version. They only see the raw HTML your server sends, before any JavaScript runs. If your text, links and headings are added later by scripts, those bots get an empty page.
Two versions of every page
Every page exists in two forms:
- The HTML your server sends. This is what you see with "View page source".
- The rendered page, after the browser runs your JavaScript and fills things in. This is what you see with "Inspect" in your browser's developer tools.
Sites built so that the browser does most of the work are called client-side
rendered: the server sends a near-empty shell, often just <div id="root"></div>, and
JavaScript builds the page. Server-side rendering (SSR) and pre-rendering do the
opposite. The page is built on the server, or ahead of time, so the HTML already
contains the content.
A quick test from Impression's JavaScript SEO guide: if a piece of text shows up in Inspect but not in View page source, it depends on JavaScript.
Who runs JavaScript, and who doesn't
Google does, with a delay. Google's JavaScript SEO basics describe three steps: crawl the HTML, queue the page for rendering, then index the rendered result. That queue can take seconds or longer, and Conductor notes that rendering costs Google far more than reading plain HTML, so it doesn't render everything right away.
Most AI crawlers don't. Vercel's analysis found that
none of the major AI crawlers render JavaScript,
including GPTBot, ClaudeBot and PerplexityBot. Some download script files but
never run them. The exceptions in that data were Google's Gemini (it uses Googlebot's
infrastructure) and Apple's crawler. So if ChatGPT or Claude visits a client-rendered
page, it reads an empty shell.
Social networks don't either. Link previews on Facebook, LinkedIn and others are built from the raw HTML, so Onely recommends keeping Open Graph tags (the title, description and image used in shared links) out of JavaScript.
Google's own advice sums it up: server-side rendering or pre-rendering is still a good idea, because not all bots can run JavaScript.
Best practices
1. Put your main content in the HTML. Text, headings, navigation and internal links should be there before any script runs. Most modern frameworks (Next.js, Nuxt, Astro, SvelteKit) can do this. If you're on a plain React or Vue setup that only renders in the browser, look at SSR or pre-rendering at build time.
2. Use real links. Bots find pages by following <a href="/page"> links. A button
with an onclick handler, href="#" or href="javascript:..." is a dead end for them.
SE Ranking lists these among the
most common mistakes.
3. Don't hide content behind clicks or scrolling. Crawlers don't click tabs, press "Load more" or scroll. If the content matters, include it in the HTML, and give infinite scroll pages normal paginated links too.
4. Give every page its own URL. Use real paths (/pricing), not fragments
(/#/pricing). Google says it can't reliably resolve fragment-based URLs.
5. Set SEO tags in the HTML, not with JavaScript. Titles, meta descriptions,
canonical tags (the "main version of this page" signal) and robots tags belong in the
first response. One trap from Google's docs: if the HTML says noindex, Google may skip
rendering, so a script that later removes it won't help.
6. Return honest status codes. A missing page should return 404, not a normal page
that says "not found". Single-page apps often get this wrong, and Google ends up indexing
error pages.
7. Don't block scripts and styles. If robots.txt blocks
your JavaScript or CSS files, Google can't render the page properly.
8. Keep JavaScript lean. Large bundles slow the page for people on phones and for
crawlers. Split code, compress files, and put a content hash in file names
(main.a1b2c3.js) so Google picks up new versions instead of a cached old one.
How Jrooky checks it
Jrooky's Server-side rendering check fetches your homepage the way an AI crawler does, with no JavaScript, and looks at what's actually in the HTML:
- how many words, headings (
h1toh3), paragraphs and links it contains, - whether there's an empty app shell, like an empty
#rootor#appcontainer, - whether there's a "please enable JavaScript" notice,
- and which framework the site uses, so the fix can be specific.
The check fails if the HTML has fewer than 50 words, or fewer than 150 words along
with an empty app shell or an "enable JavaScript" notice. Otherwise it passes, with a
tip if there's no <h1> or an empty container that might be filled in by scripts. It
only looks at your homepage, so test other key pages with View page source.
How to fix a failing result
- Open your page, choose View page source, and search for a sentence from your main content. If it's not there, it's being added by JavaScript.
- Find where that content is loaded. In Next.js, for example, data fetched in a
useEffecthook only appears in the browser. Fetch it on the server instead. - If your framework can't render on the server, pre-render your pages at build time.
- Check the result in Google Search Console's URL Inspection tool, which shows the HTML Google rendered.
This is one of the 13 points in our AI-readiness checklist.
Run a free scan to see how much of your homepage AI crawlers can actually read.