Metadata API, structured data, sitemaps, robots and Core Web Vitals โ the complete Next.js SEO checklist that gets pages indexed and ranked.
Why Next.js Wins at SEO (When Configured Right)
React SPAs render in the browser โ crawlers see an empty div first, and indexing gets unreliable. Next.js server-renders every page by default, so crawlers receive complete HTML immediately. That single difference is why Next.js is the default answer to 'which framework for SEO?'
But server rendering alone is not SEO. The framework gives you the tools โ Metadata API, file-based sitemaps, structured data support, image optimization โ and ranking comes from using all of them correctly.
The Metadata API Checklist
Every page exports metadata: a unique title (50โ60 chars), a compelling description (140โ160 chars), and a canonical URL through the alternates field โ canonicals prevent duplicate-content issues between trailing-slash variants. Use the title.template in your root layout so every page gets consistent branding.
Set metadataBase once in the root layout so relative OG image URLs resolve correctly. Add openGraph and twitter blocks per page โ social click-through is traffic Google notices.
Structured Data (JSON-LD)
Add schema.org markup: Person on a portfolio, Article on blog posts (with datePublished, author, image), BreadcrumbList on nested pages, FAQPage on FAQ sections. Google uses this for rich results, and AI search engines use it to understand your content.
Inject it with a script tag of type application/ld+json inside the page or layout. Validate with Google's Rich Results Test after every deploy โ broken markup silently does nothing.
Sitemaps, Robots and Indexing
Generate sitemap.xml and robots.txt as code (app/sitemap.js, app/robots.js) so they stay in sync with your routes automatically โ a hand-maintained sitemap is always out of date. Reference the sitemap from robots and from Google Search Console.
After publishing, request indexing in Search Console for key pages. Check the Pages report monthly: 'Crawled โ currently not indexed' usually means thin content or weak internal linking, not a technical bug.
Performance Is an SEO Feature
Core Web Vitals are a ranking input: optimise the LCP image (priority prop, correct sizes), avoid layout shifts (explicit dimensions), keep interactions fast. Use next/image everywhere, self-host fonts with next/font, and keep client components small.
One often-missed item: security headers including a correct Content-Security-Policy. They protect your rankings too โ a hacked or spam-injected site gets deindexed fast.
Conclusion
Next.js SEO is a checklist, not a mystery: complete metadata on every page, structured data, a code-generated sitemap and robots, fast Core Web Vitals, and content that answers real questions. Do all five consistently and indexing follows.
Every site I build ships with this exact SEO stack configured from day one. Want your Next.js site audited or rebuilt properly? Let's talk.
Want help with your project?
I build fast, modern and SEO-ready websites. Let's talk about what you need โ I usually respond within a few hours.
Get in Touch โ
Malik Kashan
Frontend & WordPress Developer ยท Lahore, Pakistan
I build fast, SEO-ready websites for startups and businesses worldwide using Next.js, React and WordPress.
Hire Me for Your Project
