Nightcrop
LoginGet started

JavaScript SEO: How to Make JS Pages Indexable

Nightcrop · November 17, 2026

JavaScript SEO is making sure search engines can find, render and index content that your scripts build. Google can run JavaScript, but only on pages it is allowed to crawl and with a delay. Put key content and links in the server's HTML, use real links, and return honest status codes.

How does Google process JavaScript pages?

Google's JavaScript SEO basics describe three phases: crawling, rendering and indexing. Googlebot first checks robots.txt. If the URL is blocked, it is skipped, and Google says it will not render JavaScript from blocked files or on blocked pages. Pages that return a 200 status are queued for rendering, where a headless Chromium browser runs the scripts. Google then indexes the rendered HTML and pulls links from it.

Two practical points follow. Rendering is a separate step, so content that exists only after scripts run can be picked up later than content in the raw HTML. And pages with non-200 responses, such as a 404, may skip rendering entirely.

Is server-side rendering still worth it?

Yes, for pages you want found. Server-side rendering (SSR) means the server sends finished HTML, and pre-rendering generates that HTML ahead of time. Google still recommends both, because they make the site faster for users and crawlers, and not every bot can run JavaScript.

That last point matters more than it used to. Search is no longer only Google. Our guide to AI crawlers covers the bots that feed AI answers. Do not assume each of them renders scripts the way Googlebot does. If a fact only appears after a script runs, treat it as invisible to any crawler that does not run scripts, and test it.

What are the common JavaScript SEO problems?

ProblemWhy it hurtsFix
Links built with onclick or router attributesGoogle can discover links only when they are anchor elements with an hrefUse <a href="/path"> and let your script intercept the click
Content that loads only after a click or scrollThe renderer does not click or scroll like a personPut important text in the initial HTML or load it on page load
Error pages that return 200Single-page apps often show "not found" with a 200, creating soft 404sReturn a real 404, or add noindex to error views
Scripts blocked in robots.txtBlocked files are not renderedAllow the files a page needs to display
noindex in the first HTMLGoogle may skip rendering, so a script that removes it may never runNever ship noindex on a page you want indexed

How should you build links in a JavaScript app?

Google's crawlable links guidance is specific. Links inserted by JavaScript are fine if they use the same markup: an anchor element with an href that resolves to a real URL. Extra attributes such as a class or an onclick handler are fine next to a valid href. An onclick handler with no href, a framework router attribute instead of href, or an href on a span are not recommended.

If your framework offers a link component, check what it outputs in the rendered page. Most produce a proper anchor. Some custom components do not. Good internal links also depend on structure, so see internal linking for small sites.

How do you handle status codes in a single-page app?

Google says status codes tell it whether a page can be crawled or indexed, and that client-side routing often makes meaningful codes hard. It offers two workarounds: redirect with JavaScript to a URL where the server returns a 404, or add a noindex robots meta tag to error pages with JavaScript. Our posts on soft 404 errors and the noindex tag explain both.

How do you test what Google sees?

  1. Open the page, view source, and search for your main heading and first paragraph. If they are missing, they depend on scripts.
  2. Run the URL through the URL Inspection tool in Search Console and look at the rendered HTML. Google recommends this check for inserted links.
  3. Check that the page is not blocked in robots.txt, including its script files.
  4. Confirm the status code in your browser's network panel.
  5. Look up the page in the index. How to check if a page is indexed by Google shows how.

Frequently Asked Questions

Can Google index JavaScript?

Yes. It renders pages with a headless Chromium browser after crawling them, then indexes the rendered HTML. The rendering happens in a queue, so it is not instant.

Is JavaScript bad for SEO?

No, but it adds ways to go wrong. The risks are hidden links, content that needs interaction, and wrong status codes. Fix those and a JavaScript site can rank normally.

Do I need server-side rendering?

Not strictly, but Google still recommends it or pre-rendering. It helps users, and it covers crawlers that do not run scripts.

Why are my JavaScript links not crawled?

Most often they are not anchor elements with an href. Click handlers and router attributes alone are not reliable for discovery.

Should I block JavaScript files in robots.txt?

No. Google does not render blocked files, so blocking them can leave pages looking empty to the renderer.