Why does server rendering matter for SEO?
Google can render JavaScript. Its JavaScript SEO documentation describes three phases: crawling, rendering and indexing. Pages wait in a render queue until a headless Chromium has capacity to run their JavaScript.
How long is that wait? Vercel and MERJ analysed over 100,000 Googlebot fetches on nextjs.org in April 2024. Every HTML page was eventually fully rendered. The median delay between crawl and render was 10 seconds, but the 90th percentile was about 3 hours and the 99th about 18 hours.
Google is no longer the only reader, though. The same team found that major AI crawlers don't execute JavaScript. Give GPTBot or ClaudeBot a client-rendered React app and it gets the HTML shell and nothing else.
Runs JavaScript
Googlebot
Renders later. Median delay 10 s, 90th percentile ≈ 3 h.
Runs JavaScript
Gemini
Uses Googlebot's rendering infrastructure.
Runs JavaScript
Applebot
Browser-based crawler.
No JavaScript
GPTBot / OAI-SearchBot
Reads the initial HTML only.
No JavaScript
ClaudeBot
Reads the initial HTML only.
No JavaScript
PerplexityBot
Reads the initial HTML only.
Server-rendered HTML is the only version every crawler on this list can read.
In the App Router, components are Server Components by default. They render to HTML on the server, at build time for static routes or per request for dynamic ones, so headings, text, links and image tags arrive in the first response. Client Components are pre-rendered to HTML on the server as well. The problem only appears with content fetched in the browser after the page loads, for example inside a useEffect.
How do you set page metadata in the Next.js App Router?
The built-in Metadata API replaces third-party head managers. Export a static metadata object for fixed pages, or a generateMetadata function for routes that depend on data, like blog posts. In Next.js 15 and later, params is a Promise, so it has to be awaited.
import type { Metadata } from "next";
import { getBlogPost } from "@/content/blog";
type Props = { params: Promise<{ slug: string }> };
export async function generateMetadata({ params }: Props): Promise<Metadata> {
const { slug } = await params;
const post = getBlogPost(slug);
if (!post) return {};
return {
title: post.title,
description: post.excerpt,
alternates: { canonical: `/blog/${slug}` },
openGraph: { type: "article", images: [post.coverImage] },
};
}- Set
metadataBasein the root layout so relative canonical and Open Graph URLs resolve to absolute ones. - Use
title.templatein the root layout (for example%s | Your Name) so every page gets a consistent title. - Give every indexable route its own canonical URL.
- Add
max-image-preview: largeto the robots settings if you want large image previews in Google results and Discover. - Render JSON-LD in a
<script type="application/ld+json">tag inside the page, and escape<characters so the data can't close the script tag early.
How do next/image and next/font improve Core Web Vitals?
Core Web Vitals are three metrics measured from real visits: Largest Contentful Paint (LCP) for loading, Interaction to Next Paint (INP) for responsiveness, and Cumulative Layout Shift (CLS) for visual stability. INP replaced First Input Delay in March 2024. A page passes when at least 75% of visits hit the "good" threshold.
Google uses them as part of its page experience signals, but it is clear that helpful content still matters more. A fast page won't outrank a more useful one. Treat good scores as a baseline.
LCP
Largest Contentful Paint
Good ≤ 2.5 sNeeds work 2.5–4 sPoor > 4 sINP
Interaction to Next Paint
Good ≤ 200 msNeeds work 200–500 msPoor > 500 msCLS
Cumulative Layout Shift
Good ≤ 0.1Needs work 0.1–0.25Poor > 0.25
next/imagereserves space for each image usingwidthandheight(orfillinside a sized parent), which stops images from pushing content around as they load.- It serves resized WebP files by default, and AVIF if you enable it in
next.config. - Mark the main above-the-fold image with
priority(renamedpreloadin Next.js 16) so the browser fetches it early. Use it on one image per page, not all of them. - Images below the fold are lazy-loaded by default.
next/fontdownloads Google Fonts at build time, serves them from your own domain, and generates a size-adjusted fallback font to reduce layout shift while the real font loads.
How do you generate a sitemap and robots.txt in Next.js?
Add app/sitemap.ts and app/robots.ts, and Next.js serves them as /sitemap.xml and /robots.txt. Because the sitemap is built from the same data as the pages, a new post appears in it on the next build and nobody has to edit XML by hand. This is a trimmed version of the sitemap for this site:
import type { MetadataRoute } from "next";
import { getAllPostSlugs } from "@/content/blog";
const SITE_URL = "https://sachinvishwa.tech";
export default function sitemap(): MetadataRoute.Sitemap {
return [
{ url: `${SITE_URL}/`, priority: 1 },
{ url: `${SITE_URL}/blog`, priority: 0.9 },
...getAllPostSlugs().map((slug) => ({
url: `${SITE_URL}/blog/${slug}`,
priority: 0.7,
})),
];
}In robots.ts, decide on purpose which bots to allow. OpenAI runs separate crawlers: blocking GPTBot keeps your content out of model training, while blocking OAI-SearchBot keeps you out of ChatGPT search results. Many sites block one and allow the other.
Technical SEO checklist for a Next.js launch
These are the checks I run before a Next.js site goes live. They cover what I set up when I rebuilt the Cleveress website on the App Router: page metadata, structured data, a generated sitemap, permanent redirects from old URLs, and analytics.

- View the source of key pages and confirm headings and body text are in the HTML.
- Every page has a unique title, description and canonical URL.
- Old URLs redirect permanently via
redirects()innext.config. Next.js uses status 308, which Google treats the same as a 301. sitemap.xmllists only canonical, indexable URLs and is submitted in Google Search Console.- Structured data passes Google's Rich Results Test or the Schema Markup Validator.
- LCP, INP and CLS are checked in PageSpeed Insights, then monitored in Search Console's Core Web Vitals report once real-user data comes in.
Frequently asked questions
Is Next.js good for SEO?
Yes, mainly because pages render on the server by default, so crawlers get complete HTML. The framework doesn't rank a site by itself, though. Content, links and site structure still do most of the work.
Can Google index a client-side rendered React app?
Yes. Googlebot renders JavaScript, but rendering is a separate, queued step, and AI crawlers like GPTBot and ClaudeBot don't run JavaScript at all. Server rendering avoids both problems.
Do I need the next-seo package with the App Router?
No. The built-in Metadata API handles titles, descriptions, canonical URLs, Open Graph, Twitter cards and robots directives.
Is static or dynamic rendering better for SEO?
Both send full HTML to crawlers. Static pages are faster and cheaper to serve, so use dynamic rendering only when a page depends on data that changes per request.
Sources
- Google Search Central: Understand JavaScript SEO basics
- Vercel: How Google handles JavaScript throughout the indexing process (July 2024)
- Vercel: The rise of the AI crawler (December 2024)
- web.dev: Web Vitals
- Google Search Central: Understanding page experience
- Next.js docs: Image component
- Next.js docs: sitemap.xml file convention
- OpenAI: Overview of OpenAI crawlers
