Skip to content
Back to Blog
SEO5 min read India

SEO for Next.js and React Websites: What Actually Matters

In short

React sites have a reputation for weak SEO. With Next.js and server rendering that's no longer true — if you get a handful of things right. Here's the checklist I use.

Early single-page React apps often shipped an empty HTML shell and built the page in the browser, which made search engines work harder to see the content. Next.js changed that by rendering pages on the server. Google can render JavaScript, but server-rendered HTML is faster, more reliable and friendlier to every crawler, including AI search bots. This is how I set up SEO on the Next.js sites I build — including this one.

Render content on the server

Google's JavaScript SEO guide explains that it crawls, renders and then indexes pages — and rendering can be delayed. Other crawlers may not execute JavaScript at all. With Next.js Server Components, the main content is already in the HTML the server sends, so every crawler sees it immediately.

Keep important content, links and headings out of components that only render in the browser after interaction.

Unique titles and descriptions for every page

Next.js provides a Metadata API — a static metadata object or a generateMetadata function per route — to set titles, descriptions, Open Graph images and more. Generate them from real page data: a product page's title should include the product name, a location page its city.

Google may rewrite title links that are vague, repetitive or stuffed with keywords, so write titles that describe the page clearly.

Canonical URLs and one preferred host

Decide whether your site lives at the bare domain or at www, and make everything agree: redirects, canonical tags, the sitemap and internal links. If the canonical tag points to a URL that redirects elsewhere, you send mixed signals. Set a canonical on each page with the alternates field in the Metadata API.

Sitemap and robots

Next.js can generate sitemap.xml and robots.txt from code, so new pages appear in the sitemap automatically. Include only indexable, canonical URLs, and submit the sitemap in Search Console.

Structured data from the same data as the page

Render JSON-LD in the page component using the same data that renders the visible content. Organization and Person on the layout, Article on posts, Product on product pages, BreadcrumbList on nested pages. Because it comes from one source, it never drifts out of sync.

Real links and a clear structure

Use real anchor links (Next.js Link renders them) for navigation, not click handlers on divs. Crawlers follow links; they don't click buttons. Group related pages, link between them in content, and keep important pages within a few clicks of the home page.

Common Next.js SEO mistakes

  • Rendering main content only in client components after data fetches in the browser
  • Using buttons or onClick handlers instead of real links for navigation
  • Every page sharing the same title and description from the root layout
  • Canonical URLs built from the wrong host or missing entirely
  • Staging deployments left indexable, creating duplicate content
  • Heavy client-side libraries pulled into every page
  • Images without dimensions, causing layout shift

Dynamic routes: products, locations and posts

Most SEO value on business sites sits in dynamic routes — a page per product, location or article. In Next.js each one should generate its own metadata from its data, return a proper 404 when the item doesn't exist (so empty pages don't get indexed), and be included in the generated sitemap. Pages that shouldn't be indexed — drafts, filtered views, internal search results — should carry a noindex robots directive.

Checking what search engines see

View the page source (not the browser's inspector) to see the HTML the server sends; the main content and links should be there. Search Console's URL Inspection tool shows how Googlebot rendered the page and any resources it couldn't load. Lighthouse and PageSpeed Insights cover performance and basic SEO checks.

International and multilingual sites

If a Next.js site serves several languages or regions, each version needs its own URL (for example '/en/…' and '/gu/…'), its own translated metadata, and hreflang annotations linking the versions together. Next.js metadata supports alternate language URLs, so these can be generated from the same routing data as the pages. Avoid switching language purely by browser settings without distinct URLs — search engines need separate addresses to index each version.

Caching, freshness and dynamic content

Next.js can render pages statically, on each request, or statically with periodic revalidation. For SEO, all three work as long as crawlers receive complete HTML. The choice is about freshness and performance: product prices and stock may need frequent updates; blog posts rarely change. Make sure sitemaps reflect real last-modified dates, which helps crawlers prioritise what changed.

Open Graph and social previews

Social previews aren't a ranking factor, but they affect whether people click links shared on WhatsApp, LinkedIn and elsewhere. Next.js can generate Open Graph images per page, including dynamically — for example with the page title on a branded background. Check how key pages look when shared before launch.

A launch checklist for Next.js sites

  • Production domain set as the canonical base URL
  • Unique metadata on every route, including dynamic ones
  • sitemap.xml and robots.txt generated and correct
  • Missing items return real 404 responses
  • Preview deployments protected or noindexed
  • Structured data validated on key templates
  • Core Web Vitals checked on a mid-range phone

Migrating an existing site to Next.js

Moving from WordPress or another platform to Next.js is a site migration: keep URLs where possible, redirect the rest permanently, carry over titles and content, and monitor Search Console after launch.

Keep monitoring

After launch, watch Search Console's page indexing and Core Web Vitals reports monthly. Framework upgrades and new features can quietly change rendering or metadata, so re-check key templates after major releases.

Images and performance

The Next.js Image component serves correctly sized, modern-format images and lazy-loads by default. Mark the largest above-the-fold image as priority to help LCP. Keep client-side JavaScript lean: every interactive widget adds to INP on mid-range phones.

Frequently Asked Questions

Is React bad for SEO?

Not when pages are rendered on the server, as Next.js does. Problems arise when content only appears after JavaScript runs in the browser.

Can Google index client-side rendered pages?

Google can render JavaScript, but rendering may be delayed and other crawlers may not render at all. Server rendering is more reliable.

How do I add meta tags in the Next.js App Router?

Export a metadata object or a generateMetadata function from a page or layout; Next.js renders the tags in the page head.

Should my site use www or not?

Either works. What matters is choosing one and making redirects, canonical tags, the sitemap and internal links all use it.

Does Next.js generate a sitemap automatically?

It can generate one from a sitemap file in the app directory, built from your routes and data, so it stays up to date.

How do I stop Vercel preview deployments being indexed?

Make sure preview and staging URLs send a noindex directive or are protected, and that canonical tags always point to the production domain.

How should a multilingual Next.js site be structured for SEO?

Give each language its own URL, translate the metadata, and add hreflang annotations linking the versions.

Key Takeaways

  • Render important content on the server so every crawler sees it.
  • Generate unique titles and descriptions from real page data.
  • Make canonical tags, redirects and the sitemap agree on one host.
  • Build JSON-LD from the same data as the visible page.
  • Use real links and keep client-side JavaScript lean.

Sources & further reading

  1. Understand JavaScript SEO basics — Google Search Central
  2. Metadata and OG images — Next.js
  3. Server and Client Components — Next.js
  4. What is URL canonicalization — Google Search Central
  5. Influencing title links in Google Search — Google Search Central
  6. What is a sitemap — Google Search Central
  7. Next.js SEO course — Next.js
  8. Localized versions of your pages — Google Search Central

Have a project that touches seo? See SEO, AEO & GEO services.

Get in touch

Comments

By posting a comment, you agree to the Terms & Conditions and Privacy Policy.