Skip to content
Web Development

Is Next.js Good for SEO? What Helps and What Breaks It

Is Next.js good for SEO? Yes: it serves full HTML and has built-in metadata, sitemap and image tools. Here are the build mistakes that still cost rankings.

Keshur Gojiya

7 min read

Is Next.js Good for SEO? What Helps and What Breaks It

Yes, Next.js is good for SEO, because it can send search engines a complete HTML page instead of an empty shell that JavaScript fills in later. Pages can be prerendered at build time, regenerated in the background when content changes, or rendered on the server for each request, and Next.js has built-in tools for titles, descriptions, canonical URLs, sitemaps, images and fonts. What it can't do is make a site rank by itself: a carelessly built Next.js site can have the same SEO problems as any other.

Why Next.js is good for SEO: crawlers get the full HTML

A React single-page app often sends a nearly empty HTML file and builds the page in the browser. Google can render JavaScript, but it puts pages in a queue for that step, and its own documentation points out that not all bots can run JavaScript.

In the Next.js App Router, layouts and pages are Server Components by default, and even Client Components (the interactive ones marked 'use client') are rendered to HTML on the server for the first load. So a page's headings, text and links are in the HTML a crawler receives.

How a Next.js page gets its HTML

  • Prerendering (static rendering). The page is rendered at build time and served as ready-made HTML, often from a CDN. This is the default for any route that doesn't read request-time data such as cookies(), headers() or searchParams. It suits marketing pages and blog posts.
  • Incremental Static Regeneration (ISR). A prerendered page is regenerated in the background, either on a timer (the revalidate setting) or on demand with revalidatePath or revalidateTag, for example when an editor publishes in the CMS. Projects that enable Cache Components do the same with the 'use cache' directive.
  • Dynamic rendering. The page is rendered on the server for each request, for example search results or a logged-in view. The HTML is still complete, just slower to start arriving than a prerendered page.

Built-in SEO features in Next.js

  • Metadata API. Export a metadata object, or a generateMetadata function for pages built from CMS data, from a layout or page file. Next.js writes the title, description, canonical link, robots and Open Graph tags into the page. A title.template in the root layout, such as '%s | Company name', keeps titles consistent.
  • Sitemap and robots files. An app/sitemap.ts file can generate sitemap.xml from your CMS content, and app/robots.ts generates robots.txt. Plain static files work too.
  • `next/image`. Width and height reserve the image's space, images are lazy-loaded by default, and they are resized and served in modern formats such as WebP. Turn lazy loading off for the main above-the-fold image with loading="eager", because a lazy hero image delays Largest Contentful Paint.
  • `next/font`. It self-hosts your fonts and is designed to avoid the layout shift that web fonts often cause.
  • `next/link`. Its Link component renders real <a href> links, which crawlers follow.

What a well-built page's head should output

This is what a service page's HTML should contain. Use "view page source" (not the inspector) to see what crawlers receive:

<head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1" />
  <title>Emergency Plumber in Leeds | Northside Plumbing</title>
  <meta name="description" content="Burst pipes, leaks and blocked drains fixed day or night across Leeds, with a fixed call-out fee." />
  <link rel="canonical" href="https://www.example.com/services/emergency-plumber" />
  <meta property="og:title" content="Emergency Plumber in Leeds" />
  <meta property="og:description" content="Burst pipes, leaks and blocked drains fixed day or night." />
  <meta property="og:url" content="https://www.example.com/services/emergency-plumber" />
  <meta property="og:image" content="https://www.example.com/og/emergency-plumber.jpg" />
</head>

Look for one title, one description, a canonical pointing to the page's own preferred URL, and absolute URLs (set metadataBase in the root layout for that). A robots tag saying "index, follow" isn't needed; it's the default. On dynamically rendered pages, Next.js may stream these tags into the body; Googlebot handles that, and crawlers known not to run JavaScript get them in the head.

Common Next.js SEO problems, and how to avoid them

Key content that loads only in the browser

A Client Component that fetches the page's content in useEffect after load leaves a spinner in the HTML instead of text. Fetch content in Server Components so it is part of the HTML. The same goes for tabs and accordions: render their content and hide it with CSS, rather than adding it only when someone clicks.

Missing or duplicate titles and descriptions

Metadata set only in the root layout gives every page the same title. Each template needs its own, and CMS-driven pages need generateMetadata reading the SEO fields from the CMS. Metadata from nested segments is merged shallowly: if a page sets openGraph, it replaces the layout's whole openGraph object, so any fields the page leaves out disappear.

No canonical URLs

The same page can often be reached at several addresses: with tracking parameters such as ?utm_source=, with sort or filter parameters, or on both www and non-www. Set alternates.canonical on every page, and redirect the host you don't use to the one you do.

Missing redirects after a redesign

When a Next.js site replaces an old one, every URL that changes needs a permanent redirect, or the links and rankings pointing at old pages are lost. In next.config.js, a redirect with permanent: true returns a 308 status, which Google treats as permanent, the same as a 301. If you are moving from WordPress, my free WordPress to Next.js redirect generator turns a list of old URLs or a sitemap into redirect rules.

Heavy client JavaScript that hurts INP

Interaction to Next Paint (INP) is the Core Web Vital that measures how quickly a page responds to taps, clicks and key presses; Google's target is under 200 milliseconds. Putting 'use client' at the top of a large layout pulls everything it imports into the browser bundle. Keep Client Components small and close to the interactive part, such as a menu button, and load third-party scripts like chat widgets with next/script and a later strategy such as lazyOnload.

Soft 404s

If someone requests a slug that doesn't exist and the template renders an empty page with a 200 status, Google sees a soft 404. Call notFound() when the CMS returns nothing. It sends a real 404 when it runs before the response starts; if it runs inside a Suspense boundary after streaming has begun, the status stays 200 but Next.js adds a noindex tag.

How to check if a Next.js site is SEO-ready

  1. View the source of key pages: the main text and links should be in the HTML.
  2. Confirm every template has its own title, description and canonical URL.
  3. Open /sitemap.xml and /robots.txt: the sitemap should list only live, canonical URLs, and robots should allow crawling.
  4. Request a made-up URL and confirm the browser's network tab shows a 404 status.
  5. Test a few old URLs: each should reach its new page in one redirect.
  6. Check Core Web Vitals in Google Search Console or PageSpeed Insights.

When I build a Next.js website from a Figma design, I set up the metadata, canonical URLs, sitemap and robots file with the first template, because adding them to finished pages later takes longer.

FAQ

Is Next.js better for SEO than React?

Next.js is built on React; the difference is rendering. A React app rendered only in the browser sends crawlers a nearly empty HTML file, while Next.js sends complete HTML, which makes it the safer choice for a site that depends on search traffic.

Can Google index a client-side rendered website?

Yes. Google renders JavaScript and can index content that scripts add, but pages wait in a queue for rendering, and a script error can hide content. Other crawlers may not run JavaScript at all.

Does the App Router or Pages Router matter for SEO?

Both can send complete HTML, so either can rank well. The App Router adds the Metadata API and file conventions for sitemaps, robots files and share images, while the Pages Router uses next/head and functions such as getStaticProps. For a new site, I use the App Router.

Do I need a package like next-seo with the App Router?

Usually not. The built-in Metadata API covers titles, descriptions, canonical URLs, robots rules and Open Graph tags. Structured data can be added as a JSON-LD script tag rendered by the page.

Key takeaways

  • Next.js is good for SEO because it can serve complete HTML through prerendering, ISR or server rendering.
  • The Metadata API, sitemap and robots files, next/image and next/font cover the technical basics when every template uses them.
  • Most Next.js SEO problems come from the build: content fetched in the browser, duplicate metadata, missing canonicals and redirects, heavy client JavaScript and soft 404s.
  • Check the page source, status codes and Core Web Vitals before and after launch.

Tags

  • Next.js
  • SEO
  • Web Performance

About Keshur Gojiya

Web developer and HTML email specialist with 6+ years of experience, building websites and emails for businesses, startups and agencies.

Get to know me
Keep Reading
View All Articles
  • Web Development

    7 min read

    WordPress to Next.js Migration Checklist: 6 Stages in Order

    A WordPress to Next.js migration checklist in six stages: audit, build, redirects, staging QA, launch day and the first weeks, so nothing gets lost.

    • WordPress Migration
    • Next.js
    Keshur Gojiya
  • Web Development

    6 min read

    How to Hire a Next.js Developer: What to Check and Ask

    How to hire a Next.js developer: what to check in their work, questions to ask before you sign, red flags, freelancer vs agency, and how to write a clear brief.

    • Next.js
    • Best Practices
    Keshur Gojiya
  • Web Development

    7 min read

    Is a Headless CMS Good for SEO? What to Set Up

    Is a headless CMS good for SEO? Yes, if the site is built right. The checklist: rendering, SEO fields, URLs, sitemaps, redirects, images and page speed.

    • SEO
    • Sanity CMS
    Keshur Gojiya

Need help with an email or website?

If an email is breaking in Outlook or dark mode, or you have a design that needs building, tell me about it and I’ll reply with next steps.

Email me