Google JavaScript SEO basics

Google JavaScript SEO basics,
as documented

How Google processes JavaScript in three phases and what it recommends for titles, canonicals, status codes and routing, in Google's own words. Verified from Google's pages on 2026-10-07.

Google says it runs JavaScript with an evergreen version of Chromium and processes JavaScript web apps in three main phases: crawling, rendering and indexing. This page lists what Google documents about making JavaScript sites work in Search, with the wording taken from its page.

What Google documents

TopicWhat Google saysSource
Three phases “Google processes JavaScript web apps in three main phases: Crawling Rendering Indexing” Google docs
Verified 2026-10-07
Robots.txt first “Google Search won't render JavaScript from blocked files or on blocked pages.” Google docs
Verified 2026-10-07
JavaScript-injected links “It's fine to use JavaScript to inject links into the DOM, as long as such links follow the best practices for crawlable links .” Google docs
Verified 2026-10-07
App shell sites “Some JavaScript sites may use the app shell model where the initial HTML does not contain the actual content and Google needs to execute JavaScript before being able to see the actual page content that JavaScript generates.” Google docs
Verified 2026-10-07
Render queue “Googlebot queues all pages with a 200 HTTP status code for rendering, unless a robots meta tag or header tells Google not to index the page.” Google docs
Verified 2026-10-07
Rendering delay “The page may stay on this queue for a few seconds, but it can take longer than that.” Google docs
Verified 2026-10-07
Rendered HTML is indexed “Google also uses the rendered HTML to index the page.” Google docs
Verified 2026-10-07
Non-200 pages “If the HTTP status code is non- 200 (for example, on error pages with 404 status code), rendering might be skipped.” Google docs
Verified 2026-10-07
Server-side rendering “server-side or pre-rendering is still a great idea because it makes your website faster for users and crawlers, and not all bots can run JavaScript.” Google docs
Verified 2026-10-07
Titles and descriptions “You can use JavaScript to set or change the meta description as well as the <title> element.” Google docs
Verified 2026-10-07
Canonical with JavaScript “The best way to set the canonical URL is to use HTML, but if you have to use JavaScript, make sure that you always set the canonical URL to the same value as the original HTML.” Google docs
Verified 2026-10-07
Meaningful status codes “To tell Googlebot if a page can't be crawled or indexed, use a meaningful status code, like a 404 for a page that could not be found or a 401 code for pages behind a login.” Google docs
Verified 2026-10-07
Soft 404s in single-page apps “To avoid soft 404 errors when using client-side rendering and routing, use one of the following strategies:”Google's two strategies: a JavaScript redirect to a URL for which the server responds with a 404 status code (for example /not-found), or adding a robots meta tag with noindex to error pages using JavaScript. Google docs
Verified 2026-10-07
History API, not fragments “To ensure that Googlebot can parse and extract your URLs, don't use fragments to load different page content.” Google docs
Verified 2026-10-07
Routing “For single-page applications with client-side routing, use the History API to implement routing between different views of your web app.” Google docs
Verified 2026-10-07
Injected canonical “Google Search will pick up the injected canonical URL when rendering the page.” Google docs
Verified 2026-10-07

Read on 2026-10-07. Google's page showed "Last updated 2026-03-04 UTC". Notes under a quote are close paraphrases of the same page. This page covers only what Google documents; other search engines may differ.

Examples

Google's own examples: the History API approach to client-side routing, and marking an error view with noindex when the page cannot return a 404.

<!-- Client-side routing with real URLs (History API) -->
<nav>
  <ul>
    <li><a href="/products">Our products</a></li>
    <li><a href="/services">Our services</a></li>
  </ul>
</nav>
<script>
  function goToPage(event) {
    event.preventDefault(); // stop the browser from navigating to the destination URL.
    const hrefUrl = event.target.getAttribute('href');
    window.history.pushState({}, window.title, hrefUrl); // update the URL as well as the browser history.
  }
</script>

<!-- Error view in a single-page app: add noindex with JavaScript -->
const metaRobots = document.createElement('meta');
metaRobots.name = 'robots';
metaRobots.content = 'noindex';
document.head.appendChild(metaRobots);

Mobile-first indexing: Google mobile-first indexing.

Page experience and Core Web Vitals: Google page experience and Core Web Vitals.

The status codes in detail: Google HTTP status codes guide.

Check what a page's HTML contains with the free meta tag checker and canonical tag checker, and see Google's link best practices and Google's robots meta tag directives.

Rules to remember

  • Google says it renders pages with a 200 status code and uses the rendered HTML to index them, but rendering can take longer than a few seconds.
  • Google says to use meaningful HTTP status codes, and to avoid soft 404s in single-page apps with a redirect to a real 404 or a noindex tag.
  • Google says to use the History API rather than URL fragments, and real a elements with href attributes for links.

What Google documents about paginated and infinite-scroll content: Google pagination guidance.

Questions

Does Google run JavaScript?

Yes. Google says Google Search runs JavaScript with an evergreen version of Chromium, and that it processes JavaScript web apps in three phases: crawling, rendering and indexing. A headless Chromium renders the page once Google's resources allow, and the rendered HTML is used to index the page.

Is server-side rendering still worth it?

Google says server-side or pre-rendering is still a great idea because it makes your website faster for users and crawlers, and not all bots can run JavaScript.

Can I set the title, meta description or canonical with JavaScript?

Google says you can use JavaScript to set or change the title element and meta description. For the canonical, it says the best way is HTML; if you must use JavaScript, always set the same value as the original HTML, or leave it out of the HTML and set it only with JavaScript.

How do I avoid soft 404s in a single-page app?

Google gives two strategies: use a JavaScript redirect to a URL for which the server responds with a 404 status code, or add a robots meta tag with noindex to error pages using JavaScript.

Can I use URL fragments for routing?

Google says not to use fragments to load different page content, because Googlebot can't reliably resolve those URLs. It says to use the History API for routing between views.

Is JavaScript rendered for blocked or error pages?

Google says it won't render JavaScript from blocked files or on blocked pages, and that for pages with a non-200 status code, such as a 404 error page, rendering might be skipped.

How current is this page?

Every row was read from Google's page on 2026-10-07, which showed "Last updated 2026-03-04 UTC". Google can change its documentation, so treat the linked page as the final word.

Sources

Let Balzac write the articles.

Type your website. Balzac finds the searches you can win, writes articles built to rank on Google and get cited by ChatGPT, and publishes them for you.

3 free articles · No card needed