Glossary · Technical SEO
JavaScript SEO: How Google Handles JS Pages and What to Fix
JavaScript SEO is about making sure search engines can see what your visitors see. If your content loads through scripts, this is worth an afternoon.
JavaScript SEO is the practice of making sure search engines can crawl, render and index content that depends on JavaScript. Google processes such pages in three steps: crawl, render and index. Problems arise when links, content or status codes only exist after scripts run, or when scripts are blocked.
Key Takeaways
- Google crawls, queues the page for rendering, then indexes the rendered HTML. Rendering adds delay and risk.
- Links need a real element to be discovered. Click handlers on other elements are not links to a crawler.
- Server-side rendering or pre-rendering is still a great idea in Google's words, because it speeds up users and crawlers.
- The HTTP Archive found about 2% of mobile pages change their canonical during rendering. Keep canonicals identical in HTML and JS.
Your developers built a fast, modern site. It feels great in the browser. Then Search Console shows half the product pages as discovered but not indexed, and nobody can say why.
Often the answer sits in how the page is delivered: the HTML that arrives first is nearly empty, and everything useful appears only after scripts run.
How Google processes a JavaScript page
Google's documentation describes three phases: crawling, rendering and indexing. Googlebot first fetches the URL and checks robots.txt. If the response is a 200, the page joins a queue for rendering. Later, a headless Chromium runs the scripts and Google indexes the rendered HTML. The wait in the queue lasts seconds or longer, and Google adds that rendering is skipped for some non-200 responses.
Two consequences follow. A page that needs rendering to reveal its main content is indexed later and with more risk than one that delivers content in the first HTML. And anything that blocks rendering, such as a robots.txt rule that hides your script files, breaks the process. Google states it will not render JavaScript from blocked files or on blocked pages.
Other crawlers vary. Google notes that not every bot can run JavaScript, which is one reason it calls server-side rendering or pre-rendering a great idea. Any crawler that skips scripts sees an empty shell where your content should be. We cover those crawlers in our guide to getting cited by ChatGPT.
The failures we see most
Based on Google Search Central's JavaScript SEO basics and its guidance on links and mobile-first indexing.
That first row causes more lost pages than any other. Google discovers links from anchor elements with an href. A menu built from div elements that jump to pages with script looks fine to a visitor and shows a crawler a page with no exits.
Is Google seeing your pages the way visitors do?
Send your site. We compare raw HTML, rendered HTML and what Search Console reports.
Canonicals, status codes and noindex in a JS world
Google prefers rel=canonical set in the HTML, and allows JavaScript to set it only if it uses the same value as any canonical in the original HTML, or if the original HTML omits one. Multiple or conflicting canonicals produce unexpected results. The HTTP Archive's Web Almanac 2024 found that about 2% of mobile pages have their canonical changed during rendering, which is small but is almost always a mistake.
Status codes need care in single-page apps, where client-side routing means the server often returns 200 for every route. Google suggests either redirecting through JavaScript to a URL that returns a real 404, or adding a noindex robots meta tag with script. Our 404 error and HTTP status codes entries explain the status side in more detail.
Noindex is the trap. When Google sees noindex in the original HTML, it can skip rendering, so a script that removes the tag never gets the chance to run. If a page should be indexed, never ship noindex in the first HTML.
Rendering choices: what each one costs
Client-side rendering sends a near-empty HTML shell and builds the page in the browser. It is simplest for developers and riskiest for search. Server-side rendering builds the HTML on the server for each request, so crawlers and users get content immediately. Static generation builds pages ahead of time and serves them as files, which is fast and cheap for content that changes rarely. Hydration adds interactivity to server-rendered HTML afterwards.
For content sites, stores and local businesses, we lean toward server-rendered or static HTML for everything you want indexed, with JavaScript adding behavior on top. Google calls server-side rendering or pre-rendering a great idea because it improves speed for users and crawlers, and notes that not all bots run JavaScript. It also describes dynamic rendering as a workaround, not a goal.
Speed ties in here as well. Heavy bundles delay the largest element on screen, which hurts Largest Contentful Paint, and web.dev's thresholds treat 2.5 seconds or less as good.
A testing routine that takes thirty minutes
- View source. Open the raw page source, not the inspector. Is the main content, the title and the internal links there? If not, you depend entirely on rendering.
- Inspect with Google's tool. Paste the URL into the URL Inspection tool in Search Console and open the rendered HTML and screenshot. Compare them with what a visitor sees.
- Disable JavaScript. Use your browser's developer settings. If the page collapses to nothing, so does your fallback for bots that skip scripts.
- Crawl both ways. Run a crawler once without rendering and once with it, and compare link and word counts.
- Check the logs. See whether Googlebot fetched your script and CSS files. Log file analysis shows exactly what it requested.
Keep the notes. A before-and-after comparison is the clearest way to persuade a developer who is busy and skeptical.
Working with developers without a fight
Developers care about maintainable code and fast pages, and so do you. Frame requests in terms they respect: a clear failing example, the Google documentation line that supports it and the smallest change that fixes it. Ask for server-rendered HTML for templates that drive revenue, such as category and product pages, before you ask for it everywhere.
Agree on a short definition of done. A page is ready for search when the first HTML response contains the title, the main content and crawlable links, returns the right status code and passes the URL Inspection tool. Add that to the release checklist, and the problem stops recurring. Our technical SEO checklist can serve as the starting list.
Mistakes that cost indexing
Assuming that because Google can render JavaScript, it always does so quickly and completely. Hiding key content behind tabs that load on click. Using hash fragments for page changes. Blocking script folders in robots.txt years ago and forgetting. Testing only in your own browser, which has a warm cache and a fast connection.
Mobile adds one more point. Google indexes the mobile version, and its mobile-first guidance says not to lazy-load primary content behind user actions such as a click or swipe. If a tab reveals the main copy only after a tap, that copy may never be indexed. Treat any content that matters as part of the first load.
FAQ
JavaScript SEO: questions people ask
Can Google index JavaScript content?
Yes. Google crawls, renders and indexes JavaScript pages, but rendering adds delay and risk, so important content is safer in the first HTML.
Is server-side rendering required for SEO?
No, but Google calls server-side rendering or pre-rendering a great idea because it helps users and bots that cannot run JavaScript.
Do links need to be anchor tags?
Yes. Google discovers links from anchor elements with an href. Links built from other elements with click handlers are not crawlable.
Can JavaScript change my canonical tag?
It can, if the value matches the original HTML or the original has none. Conflicting canonicals produce unexpected results.
How do I test what Google sees?
Use the URL Inspection tool in Search Console and compare the rendered HTML with raw source and with what visitors see.
Rebuilding on a JavaScript framework?
Talk to us before launch and we will check what search engines will see.
How we wrote this page
Chenthil Kumar wrote this entry from the sources listed below and from audit work on client sites, and the Digimarketlabs Editorial Team checked it against our editorial guidelines. Figures carry a source and a date, and where a study shows correlation only, we say so. Search features change often, so check the linked documentation before you act on a detail. Last updated October 23, 2026.
Sources & further reading
Keep reading