Skip to content
Menu Close

ADSQUERY / Insights

JavaScript SEO for React, Next.js and Astro

Improve JavaScript SEO for React, Next.js and Astro with practical rendering, crawling and indexing checks for Google and Bing.

Your page opens perfectly in a browser, but it does not appear in Google or Bing. The framework’s name may not be the problem: content might appear only after JavaScript runs, an essential file might be blocked, or the server might return the wrong status code.

JavaScript SEO comprises technical work that helps search engines discover, process and evaluate pages that use JavaScript. React, Next.js and Astro offer different rendering options, and two websites built with the same technology can serve very different HTML to a search engine. This guide shows where to look for problems and how to verify the result. No technical setup guarantees indexing or rankings.

How do Google and Bing process JavaScript pages?

Google broadly describes the process as crawling, rendering and indexing. Googlebot checks the URL and permissions, receives the response and can queue an eligible page for rendering. The HTML produced after JavaScript execution is assessed again. Rendering time can vary; inaccessible JavaScript or API resources can leave content incomplete. Google’s JavaScript SEO guide explains the stages.

Bing can also process JavaScript, but do not infer how Bing handles a particular page from Google’s result. Use Bing URL Inspection to examine its indexed status and live URL response separately. The same page may appear in the two engines at different times or encounter different issues.

Ask three separate questions: Can the URL be discovered? Can the engine fetch and process the page and required resources? After assessment, was the content selected for the index? A crawl or a successful live test is not the same as indexing.

What is the difference between CSR, SSR and static rendering?

  • CSR (client-side rendering): Much of the content may be created in the browser after JavaScript runs. If the first response contains only an application shell, visibility depends on resources loading and rendering succeeding.
  • SSR (server-side rendering): HTML can be generated on the server when the page is requested. Delivering content in the response can reduce dependence on rendering, but server errors, caching and data access still need attention.
  • Static site generation (SSG): HTML is prepared at build time and served later. Consider when content changes trigger a rebuild or cache refresh.

A page can combine pre-rendered content with interactive client components. Hydration makes existing HTML interactive in the browser; a mismatch between the initial server and client output can cause errors. Choose an approach using content freshness, infrastructure and actual user experience together.

To assess how rendering choices affect real-user speed, see our PageSpeed and Core Web Vitals guide.

How should React websites approach JavaScript SEO?

React does not mean “CSR only”: HTML can also be produced on a server or at build time. However, if an application fetches important text only inside a browser-side useEffect, the first HTML may not contain it. React explains that Effects do not run on the server.

Suppose the first response contains only an app root and the product name is added after an API call. Not seeing the name in raw HTML does not prove that the page cannot be indexed: Google may see it after a successful render. It does mean you need to verify JavaScript, API access and error handling. Pre-rendering or serving critical content on the server may be appropriate.

Test direct URL access, what happens when the data request fails and hydration warnings. If navigation depends only on an onClick handler, also provide real href links that search engines can follow.

What should you check in Next.js?

In the Next.js App Router, pages and layouts are Server Components by default. Using "use client" does not mean the component’s initial HTML is always absent: Client Components can also be pre-rendered on the server for the initial load. Content fetched only after useEffect, or a component with SSR disabled, may depend more heavily on the browser. Inspect the actual output for your page. Next.js’s Server and Client Components guide explains the distinction.

Check that every URL receives the correct title, description and canonical. The Next.js Metadata API can help, but streaming metadata may arrive later in the response in some cases, and behaviour can differ by bot type. Do not declare metadata missing based only on the first bytes: inspect the complete response and what the relevant search engine sees. Next.js metadata documentation describes this behaviour.

What should you check in Astro?

With Astro’s default static output, pages are generally pre-rendered as HTML at build time; an appropriate adapter and configuration can also enable on-demand server rendering. Interactive islands in a static page do not mean the whole page is client-rendered. Astro’s configuration reference explains the options.

A framework component using client:only, however, is not rendered to HTML on the server. If the heading, main explanation or important internal links exist only inside that component, carefully test the initial HTML and rendered result. Astro can show an optional fallback; consider how that fallback relates to the actual content and user experience. Astro’s directives reference explains the distinction.

10 technical checks for JavaScript SEO

1. Open the URL directly and inspect its HTTP response

A real page intended for indexing should return a successful response and meaningful content under conditions accessible to the crawler. Check the final redirect destination, loops and unexpected language redirects. Showing “not found” only in the browser may not be enough for a missing page: an error page served with 200 can be treated as a soft 404. Plan an actual 404 or 410 response where appropriate. Google’s soft 404 guidance provides examples.

2. Compare source HTML with the rendered result

Look for the heading, main text, important links and metadata in the received HTML. Then inspect the browser-generated DOM and the search engine’s test output. Source HTML and the DOM are not the same thing; if content is added later, verify that the process completes successfully.

Replace the address below with your own page:

curl -sS -L -o page.html -w 'HTTP %{http_code}\nFinal URL %{url_effective}\n' https://example.com/en/guide/

This command follows redirects and saves the final response’s HTML; it does not execute JavaScript or impersonate Googlebot or Bingbot. Content absent here is not, by itself, an indexing error. Inspect intermediate redirect statuses and search-engine tool results separately.

3. Check access to JavaScript, CSS and APIs

Required resources can be blocked by robots.txt, security rules, authentication, timeouts or server errors. A page working on your own computer does not prove a bot can access the same resources. Compare the browser network panel with search-engine resource and error reports; do not remove access controls from private data solely for SEO.

4. Separate noindex from crawl blocking

Check both HTML and response headers for an unintended noindex in meta robots or X-Robots-Tag. If the initial page has noindex, Google may skip rendering, so do not rely on JavaScript removing it later. A crawl restriction in robots.txt is different from noindex and can stop the bot from reading the page’s instruction. Google’s robots and JavaScript guidance explains the difference.

5. Keep canonicals and language alternatives consistent

Check each page’s preferred URL, redirects and canonical signal. Avoid conflicting or duplicate canonicals between initial and rendered HTML. Where genuine language equivalents exist, provide accessible reciprocal hreflang links and open each version directly. A canonical is a signal, not a guarantee of the engine’s selection. Our multilingual SEO checklist covers the broader topic.

Give important pages followable links in the form <a href="...">. A link inserted by JavaScript can also be discovered if it uses suitable HTML; do not rely only on an element’s click handler. Use directly accessible URLs for pages and consider the limitations of basing page content solely on a URL fragment (#). Google’s link guidance gives examples.

7. Test data requests and hydration errors

Inspect what the page shows when an API fails, returns nothing or times out. If the first server and client output differ, investigate hydration warnings in the browser console. Content visible only after a specific cookie, session or user action can be difficult for a bot to understand on a public page.

8. Match structured data to visible content

A JSON-LD title, description, price or date should agree with what the page actually presents. Verify the markup is accessible in the initial or rendered output and is not duplicated. Correct structured data does not guarantee a rich result.

9. Treat the sitemap and IndexNow notifications separately

List current, preferred URLs you want indexed in the sitemap; remove redirecting or missing addresses. IndexNow can notify Bing and other participating engines about new or changed URLs. Acceptance does not guarantee crawling or indexing. Bing’s IndexNow guidance states the limit.

10. Verify each search engine’s actual result

Google Search Console: Separate the previously indexed version from the live test in URL Inspection. The live screenshot, resources and HTML are useful, but the live test cannot predict Google’s canonical selection or guarantee indexing. Google’s URL Inspection guide explains its scope.

Bing Webmaster Tools: Inspect both the index card and Live URL result. Bing’s documentation says the live test does not automatically follow redirects, so inspect the destination separately. Do not confuse an address returning 301 with the target page’s status. Bing’s tool guidance has the details.

Example: Three pages, three different problems

Consider three hypothetical pages in an audit:

  1. React product page: The initial HTML is an empty shell, and the rendered test also lacks product text because the API returns 500. Fix API access and the error first; consider pre-rendering critical content. Do not decide from source HTML alone.
  2. Next.js service page: A noindex setting from preview remained in the production response. Correct the unintended instruction at its source instead of expecting JavaScript to remove it later, then repeat the live test.
  3. Astro guide: The main content exists only inside a client:only component. Consider moving the main text into the pre-rendered page and leaving the interactive part as an island; compare initial and rendered output afterwards.

These are example diagnoses, not a promise that the same fix is best for every project or that an index updates immediately.

Frequently asked questions

Can React websites be indexed by Google and Bing?

Yes. The key is not the framework’s name, but whether the URL can be discovered and accessed, its content processed, and the page selected for the index. A CSR page can be processed under suitable conditions, but critical content and resource dependencies should be tested.

Is dynamic rendering that serves bots separate HTML required?

Not for every website. Google describes bot-specific dynamic rendering as a workaround rather than a long-term solution and recommends options such as server-side or static rendering. Serving different content to users and bots can cause problems. See Google’s dynamic rendering guidance.

Does a successful live test guarantee indexing?

No. A live test checks access and some technical conditions; it cannot guarantee every process, including quality assessment, canonical selection and the indexing decision. Monitor indexed status in Google and Bing separately afterwards.

For language versions, see our multilingual SEO guide; to improve discovery between pages, see our internal linking guide.

Insights →