ExplainedShare

JavaScript and Next.js sites can look empty to AI crawlers. Here's how to make sure they get read

AI crawlers that don't execute JavaScript may land on blank pages. How your site is rendered determines what Google and AI systems can actually read.

By MOBAEO Newsroom··3 min read

Follow
The sleek, modern interior of a futuristic clothing store in Bursa, Turkey.
Photo: Doruk Aksel Anıl/Pexels

Many of today's websites build their content with JavaScript, in the visitor's browser. For a search or AI crawler, that matters: if the text only appears after the code runs, any bot that doesn't execute JavaScript finds a page with no content. That's why AI SEO, AEO or GEO for a JavaScript or Next.js site starts with making sure the main content is already in the HTML the server delivers.

How Google reads JavaScript pages

According to Google Search Central documentation, Googlebot works in phases: it crawls the URL, puts the page in a queue and, when resources allow, uses a headless version of Chromium to execute the JavaScript and read the resulting HTML. The wait in that queue can be a few seconds or longer. Before anything else, the crawler checks robots.txt, and pages or files blocked there are not rendered.

Google itself calls server-side rendering or pre-rendering a good idea, because it makes the site faster for users and crawlers alike, and because not every bot can run JavaScript. The documentation also asks for unique titles and descriptions, a canonical set in the original HTML, meaningful HTTP status codes (such as a 404 for a page that doesn't exist) and links built as HTML elements with an href attribute, using the History API instead of fragments for routes.

What changes with AI crawlers

In a study by Vercel, conducted with MERJ using traffic across the company's network and the Next.js site, OpenAI's GPTBot made 569 million requests in a single month, and Anthropic's Claude crawler made 370 million. Over the same period, Googlebot logged 4.5 billion. Together, GPTBot, Claude, AppleBot and PerplexityBot reached nearly 1.3 billion fetches, just over 28% of Googlebot's volume. The study also looked at Resume Library, a job board built on Next.js.

An analysis by Search Engine Journal sums up the core issue: these AI crawlers can't render JavaScript, and sites that lean on it too heavily risk losing traffic from AI search engines like ChatGPT search. The piece also points to different priorities: GPTBot favors HTML content (57.7%), while Claude focuses more on images (35.17%).

The same analysis highlights a warning from Google's Search Off The Record podcast. "There are a lot of people who like these JavaScript frameworks and use them for things where JavaScript really makes sense, and then they think, why not use it for everything?" said John Mueller, Search Advocate at Google.

How the page gets built

In another Search Engine Journal report, covering a talk by Martin Splitt, Developer Advocate at Google, three approaches come up. Pre-rendering generates the HTML ahead of time: it's simple, robust and secure, but it doesn't respond to interactions. Server-side rendering builds the page on every visit and supports personalized content and comments, though it's more complex and uses more resources. Client-side rendering builds everything in the browser and gives the site an app-like feel.

"The main problem with client-side rendering is usually the risk that, if something goes wrong during transmission, the user won't see any of your content. That can also have SEO implications," Splitt said. He suggests a hybrid model, hydration: the server delivers the finished content and JavaScript handles the interactions afterward.

For brand teams, the sources point the same way: use server-side rendering for the main content, put that content in the initial HTML, apply progressive enhancement and use JavaScript with care. A page whose text only exists after the code runs risks being invisible to the AI crawlers studied.

Key questions

How do you do LLM SEO on a Next.js site?

Because the AI crawlers studied don't render JavaScript, the recommendation is to put the main content in the initial HTML and use server-side rendering for key content, applying progressive enhancement.

Can AI crawlers read content generated by JavaScript?

According to the study cited by Search Engine Journal, AI crawlers can't render JavaScript. Content that only appears after the code runs may not be read by them.

Can Google read sites built with JavaScript?

Yes. Googlebot executes JavaScript using a headless version of Chromium, but the page first goes through a rendering queue that can take a few seconds or longer.

How many requests does GPTBot make compared with Googlebot?

In the Vercel study, GPTBot made 569 million requests in one month, compared with 4.5 billion from Googlebot over the same period.

What's the difference between pre-rendering, server-side rendering and client-side rendering?

Pre-rendering generates the HTML ahead of time, server-side rendering builds the page on every visit, and client-side rendering builds the content in the browser with JavaScript, with the risk that the content won't appear if something fails.

What is hydration on JavaScript sites?

It's a hybrid model suggested by Martin Splitt: the server delivers already rendered content and client-side rendering handles the interactions that follow.

How do you avoid soft 404s in single-page apps?

Google suggests using JavaScript to redirect to a URL where the server responds with a 404 status code, or adding a noindex tag to error pages.

Why do site links need to be HTML elements with an href?

Google only discovers links that are HTML elements with an href attribute. On sites with browser-based routing, the recommendation is to use the History API instead of fragments.

Sources: Google Search Central, Search Engine Journal, Search Engine Journal, Vercel.