Skip to the content
Start free

JavaScript crawling

JavaScript crawling is how a search engine or AI bot fetches a page whose content is built or changed by JavaScript, runs (renders) that code, and reads the result. Google renders JavaScript before it indexes a page. Many AI crawlers were found in a December 2024 study not to render it at all, so words that only appear after scripts run can be invisible to them.

What is JavaScript crawling? #

A plain HTML page holds its words in the file the server sends. A JavaScript-heavy page often sends a near-empty shell plus scripts, and the browser builds the content. For a bot, that means 2 jobs instead of 1: fetch the file, then run the code to see what a person would see. That second job is called rendering. It costs time and computing power, so not every bot does it.

Google’s JavaScript SEO basics describes 3 phases: crawling, rendering and indexing. Pages that return a 200 status go into a render queue. The renderer is a headless, evergreen version of Chromium, the engine behind Chrome. Only after rendering does Google read the final HTML for the index.

If your words, links or product data only exist after scripts run, Google sees them later than plain HTML and only if rendering succeeds. Some limits are hard:

  • Blocked files are not rendered. Google says it will not render JavaScript from files or pages blocked in robots.txt.
  • Links must be real links. Google can only follow <a> elements with an href. Its crawlable links guide lists a span with an href, an a with only an onclick, and a javascript: href as not recommended.
  • Hash addresses are risky. Do not use the # part of a URL to load different content. Google suggests the History API for routing.
  • A late noindex is unreliable. Google warns that a noindex in the first HTML can make it skip the render step, so removing that tag later with a script is unreliable.

Why does it matter for AI answers? #

This is where the gap is widest. In The rise of the AI crawler (17 December 2024), Vercel and MERJ reported that none of the major AI crawlers they tested rendered JavaScript. They named GPTBot, ClaudeBot and PerplexityBot. These bots fetched script files but could not read content drawn by them. The same study found that Gemini uses Googlebot‘s setup and renders fully, and that Applebot renders too. That is one study at one date, so test your own pages rather than assume.

The lesson for answer engine optimisation is simple. If you want a large language model to quote your price, opening hours or product facts, put them in the HTML the server sends. Our page on technical SEO for AI search goes further.

How does rendering work on a site? #

The main choices are set out in Rendering on the Web from web.dev:

Method Where the HTML is built What a non-rendering bot sees
Server-side rendering On the server, for each request The full content
Static rendering Ahead of time, one file per address The full content
Client-side rendering In the browser, by JavaScript Often an empty shell
Hydration Server HTML first, then scripts add interaction The full content

web.dev adds a caution for client-side rendering: script size tends to swell as features are added, and a heavy bundle can drag down Interaction to Next Paint. Our comparison of client-side vs server-side rendering covers the trade-offs.

Is dynamic rendering still a fix? #

Dynamic rendering means sending bots a pre-rendered page and people the script version. Google’s page on dynamic rendering now calls it a workaround and not a recommended solution, because it adds complexity and cost. Its advice is to build the HTML on the server, at build time, or with hydration. Be careful too: showing bots different content from people with intent to mislead is cloaking.

What are the common mistakes? #

  • A single-page application that returns 200 for every address, so missing pages become soft 404s. Google suggests a script redirect to a real 404 address or a noindex on error views.
  • A canonical tag set by script that differs from the one in the HTML. Google says to use only 1 and keep them the same.
  • Old cached scripts. Google says its renderer caches hard and may ignore cache headers. File names with a content hash avoid stale code.
  • Content behind clicks or scrolls with no real address. Follow the guidance on lazy loading.
  • Blocking /js/ or /assets/ folders in robots.txt.

A worked example #

A small shop moves to a new theme. Each product page now loads its price, stock and description from a script after the page opens. In a normal browser it looks fine. View the raw source and the description box is empty. Google renders the page, so the product still gets indexed, a little slower. But when a person asks an AI assistant about that product, the AI bot fetched only the shell. It has no description and no price to quote. The fix: print the core facts in the server HTML, then let scripts add the extras like reviews or a size picker. Nothing about the look changes.

How do I check it? #

  1. Run a page through our free JavaScript SEO checker, which shows what bots that do not run JavaScript miss.
  2. Check your rules do not block script or style files with the robots.txt checker.
  3. See which AI bots can reach the page with the AI bot checker.
  4. In Google Search Console, use URL Inspection and view the rendered HTML.
  5. For many pages at once, our JavaScript rendering check (Pro) is being built.

Questions #

Does Google index JavaScript content? #

Yes, after it renders the page. Google still recommends server-side or pre-rendering because not all bots run JavaScript.

Can I add structured data with JavaScript? #

Google says you can inject JSON-LD with JavaScript, but test it. Check the result with our schema checker.

Can JavaScript set my title and meta description? #

Yes. Google says JavaScript can set or change the title and meta description. Non-rendering bots will still read the original ones.

Sources #

Updated 25 November 2026 by URSY.

Cite this page: JavaScript crawling. URSY. Updated 25 November 2026. https://ursy.com/wiki/javascript-crawling/ · Section links

Tools for this

All 871 wiki entries, A to Z →