Next.js SEO Setup Checklist for Every Project

Key takeaways
- Next.js SEO is the work of setting up a Next.js site so search engines and AI tools can find its pages and read them and show them to the right people.
- Your main content has to be inside the HTML that the server sends.
- The root layout holds your site-wide defaults and every page inherits them unless it sets its own.
- Every page you want to rank needs its own title, description and canonical URL.
Next.js comes with strong SEO tools built in. They only help when someone sets them up the right way. Plenty of new sites go live with the same title on every page, a sitemap full of dead links or a staging copy that Google can crawl. None of this shows up in the browser. It shows up a few months later as traffic that never arrives.
This checklist covers the Next.js SEO setup every project needs before launch. It works for a small business site, a large online store and a SaaS app. It is written for the App Router in Next.js 16 and it also gets your pages ready for Google AI Overviews and chat tools like ChatGPT, Claude and Perplexity.
The short version is this. Bots need real HTML from the server and every page needs its own tags. Your sitemap and robots file must match the live site. Structured data, fast pages and proper tracking finish the job.
Each step below has a short reason and a list you can tick off. Developers can copy the code samples. Business owners can use the lists to check what their team has done.
What Is Next.js SEO?
Next.js SEO is the work of setting up a Next.js site so search engines and AI tools can find its pages and read them and show them to the right people. It covers how pages render and which tags they carry. It also covers how fast they load and which bots you let in.
Next.js handles a lot of this for you. Pages render on the server by default so bots get full HTML. The Metadata API writes your title, meta tags, special files that create your sitemap and robots.txt. Problems start when a team skips these features or sets them up halfway.
Fixing gaps after launch costs more than building them in from the start. That is why our team plans Next.js SEO as part of every website build so pages go live with clean tags and real HTML from day one.
What a Complete Setup Covers
Rendering: bots get the full page text in the first HTML response
Metadata: every page has its own title, description and canonical URL
Crawl files: a sitemap and a robots.txt file that match the live site
Index control: staging copies and thin pages stay out of search
Structured data: JSON-LD that describes your business and your content
Speed: good Core Web Vitals scores on real phones
AI readiness: pages that AI search tools can read and quote
Tracking: Search Console and analytics running from launch day
Step 1: Make Sure Bots Get Real HTML
Your main content has to be inside the HTML that the server sends. Google can run JavaScript but rendering can happen some time after the first crawl. Many AI crawlers never run it at all. A 2024 study by Vercel and MERJ found that the crawlers behind ChatGPT and Claude download JavaScript files but do not execute them. If your text only appears after scripts run in the browser those bots see an empty page.
The App Router helps here because pages and layouts are Server Components by default. Their content ships in the first response. Issues appear when the main text is fetched inside a client component after the page loads.
Rendering Checklist
Fetch the main content in Server Components and not inside useEffect
Prerender pages that rarely change and use generateStaticParams for dynamic routes like blog posts
Keep headings and body text in the part of the page that renders first and put only small personal bits like a cart count inside Suspense
Prerender key pages so their metadata sits in the head instead of streaming into the body later
Use next/link for internal links so bots see a real anchor tag with an href
Avoid buttons that navigate with router.push for any link you want crawled
Open View Page Source on key pages and confirm the main text is there
Step 2: Set Site-Wide Metadata in the Root Layout
The root layout holds your site-wide defaults and every page inherits them unless it sets its own. Start with metadataBase. It turns relative paths in canonical and Open Graph tags into full URLs on your real domain.
// app/layout.tsx
import type { Metadata } from 'next'
export const metadata: Metadata = {
metadataBase: new URL('https://www.example.com'),
title: {
default: 'Example Co | Web Design Studio',
template: '%s | Example Co',
},
description: 'Fast websites for small businesses.',
openGraph: {
siteName: 'Example Co',
type: 'website',
locale: 'en_US',
},
twitter: { card: 'summary_large_image' },
}
The template adds your brand to the titles of pages below the root. A page at app/pricing/page.tsx with the title Pricing will output Pricing | Example Co.
Root Layout Checklist
Set metadataBase to your live domain with https
Add a default title and a title template
Write a fallback description for pages that miss one
Add default Open Graph and Twitter card settings
Place an opengraph-image file in the app folder as the default share image at 1200 by 630 pixels
Add favicon.ico, icon.png and apple-icon.png to the app folder
Set the lang attribute on the html tag
Export metadata only from Server Components because client components cannot export it
Step 3: Write Unique Tags for Every Page
Every page you want to rank needs its own title, description and canonical URL. A canonical tag tells Google which address is the main version of a page. Static pages can export a metadata object. Dynamic pages like posts and products use generateMetadata to build their tags from your data.
// app/blog/[slug]/page.tsx
import type { Metadata } from 'next'
import { notFound } from 'next/navigation'
import { getPost } from '@/lib/posts'
type Props = { params: Promise<{ slug: string }> }
export async function generateMetadata({ params }: Props): Promise<Metadata> {
const { slug } = await params
const post = await getPost(slug)
if (!post) notFound()
return {
title: post.title,
description: post.excerpt,
alternates: { canonical: /blog/${slug} },
}
}
Next.js shares the result of the same fetch call between generateMetadata and the page so the data loads once. If you read data through a database client wrap the function in React cache to get the same effect.
Page Tag Checklist
Write one unique title per page and put the main phrase near the start
Keep titles around 50 to 60 characters so search results rarely cut them
Write descriptions of about 150 characters that tell people what they will get
Add a self-referencing canonical to every page you want indexed
Point duplicate and filtered URLs to the main version of the page
Copy your shared Open Graph fields into any page that sets its own openGraph because the page object replaces the layout object completely
Pick each title phrase from real search data and not from guesses. Our guide on finding the right keywords shows free ways to do it.
Step 4: Generate Your Sitemap With sitemap.ts
A sitemap lists the URLs you want search engines to find. In the App Router you add app/sitemap.ts and Next.js serves it at /sitemap.xml. Build it from the same data as your pages so the list always matches the site.
// app/sitemap.ts
import type { MetadataRoute } from 'next'
import { getAllPosts } from '@/lib/posts'
const BASE_URL = 'https://www.example.com'
export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
const posts = await getAllPosts()
return [
{ url: BASE_URL },
{ url: ${BASE_URL}/services },
...posts.map((post) => ({
url: ${BASE_URL}/blog/${post.slug},
lastModified: post.updatedAt,
})),
]
}
Sitemap Checklist
List only canonical URLs that return a 200 status
Leave out redirects, noindex pages and 404s
Use real update dates for lastModified and leave the field out when you do not know the date
Skip changeFrequency and priority because Google ignores both
Split big sites with generateSitemaps since Google accepts up to 50,000 URLs per sitemap file
Add language alternates if your site runs in more than one language
Submit /sitemap.xml in Google Search Console and Bing Webmaster Tools
If this is your first sitemap our walkthrough on creating an XML sitemap and submitting it to Google covers the submission and the report you check afterward.
Step 5: Write robots.ts for Search and AI Crawlers
The robots.txt file tells crawlers which paths they may visit. In Next.js you add app/robots.ts and point it to your sitemap. Keep the rules short and block only areas that have no search value.
// app/robots.ts
import type { MetadataRoute } from 'next'
export default function robots(): MetadataRoute.Robots {
return {
rules: [
{ userAgent: '*', allow: '/', disallow: ['/admin/', '/account/'] },
// Optional: opt out of OpenAI model training
{ userAgent: 'GPTBot', disallow: '/' },
],
sitemap: 'https://www.example.com/sitemap.xml',
}
}
AI companies now run separate bots for search, for training and for user requests. Blocking one does not block the others. That lets you decide who can use your content and still stay visible in AI answers.
Bot | Company | What it does |
OAI-SearchBot | OpenAI | Finds pages for ChatGPT search answers |
GPTBot | OpenAI | Collects content for model training |
ChatGPT-User | OpenAI | Opens a page when a user asks for it |
Claude-SearchBot | Anthropic | Indexes pages for Claude search answers |
ClaudeBot | Anthropic | Collects content for model training |
Claude-User | Anthropic | Opens a page when a user asks for it |
PerplexityBot | Perplexity | Indexes pages for Perplexity answers |
Google-Extended | Controls use in Gemini apps and models and has no effect on Google Search |
OpenAI says sites that block OAI-SearchBot will not appear in ChatGPT search answers. Keep the search bots open if you want traffic from AI tools.
Robots Checklist
Allow Googlebot and Bingbot on every page you want to rank
Never block /_next/ or your CSS and JavaScript files because Google needs them to render pages
Block private areas like admin and account pages
Allow the AI search bots you want traffic from
Treat training bots as a separate business decision
Include the full sitemap URL
Remember that robots.txt controls crawling and not indexing
A page blocked in robots.txt can still show up in Google when other sites link to it. Our guide to how robots.txt differs from meta robots and X-Robots-Tag explains which control fits which job.
Step 6: Keep Staging and Thin Pages Out of the Index
Some pages should exist but never appear in search. A public staging copy is the biggest risk because it can get indexed and compete with your live site.
Vercel adds an X-Robots-Tag: noindex header to every Preview Deployment. It skips that header when you assign a custom domain to a non-production branch and other hosts may not add it at all. In those cases send the header yourself from staging builds.
// next.config.ts
import type { NextConfig } from 'next'
const isStaging = process.env.SITE_ENV === 'staging'
const nextConfig: NextConfig = {
async headers() {
if (!isStaging) return []
return [
{
source: '/:path*',
headers: [{ key: 'X-Robots-Tag', value: 'noindex' }],
},
]
},
}
export default nextConfig
On the live site add robots: { index: false } to the metadata of thin pages. Thank-you pages, internal search results and login pages are the usual examples.
Index Control Checklist
Put staging behind a password when you can
Send X-Robots-Tag noindex from every non-production copy
Run curl -I on a preview URL and look for the header
Noindex tag pages and filter combinations that add nothing new
Do not block a noindex page in robots.txt because Google has to crawl the page to see the tag
Keep noindex pages out of your sitemap
Check the live site after launch so no stray noindex reaches production
Step 7: Add Structured Data With JSON-LD
Structured data describes a page in a format machines read easily. The Next.js docs recommend rendering JSON-LD as a plain script tag inside your layout or page. Replace the less-than sign in the output so the tag cannot be used for script injection.
// app/page.tsx
export default function Home() {
const jsonLd = {
'@context': 'https://schema.org',
'@type': 'Organization',
name: 'Example Co',
url: 'https://www.example.com',
logo: 'https://www.example.com/logo.png',
}
return (
<main>
<script
type="application/ld+json"
dangerouslySetInnerHTML={{
__html: JSON.stringify(jsonLd).replace(/</g, '\\u003c'),
}}
/>
{/* page content */}
</main>
)
}
Two points matter here. Google stopped showing FAQ rich results on May 7, 2026. FAQPage markup is still valid but it no longer creates the drop-down result in search. Google's guide to AI features also says there is no special schema for AI search. Structured data still helps because it makes pages eligible for rich results like product prices and review stars.
Schema Checklist
Organization or LocalBusiness on the home page
WebSite with your site name
BreadcrumbList on deep pages
Article or BlogPosting on posts with the author and dates
Product with price and availability on store pages
Mark up only content that people can see on the page
Test with the Rich Results Test and the Schema Markup Validator
Type your objects with the schema-dts package in TypeScript projects
Our guide to schema markup for SEO explains which types fit which pages and how they support AI search.
Step 8: Pass Core Web Vitals With Built-In Components
Google measures page experience with three Core Web Vitals. Largest Contentful Paint should be 2.5 seconds or less, Interaction to Next Paint should be 200 milliseconds or less and Cumulative Layout Shift should stay at 0.1 or less. Next.js ships components that handle most of the work.
Speed Checklist
Use next/image for content images, set width and height or fill so the browser reserves the space
Give the main above-the-fold image loading="eager" and fetchPriority="high" or use the preload prop for one known hero image
Drop the old priority prop since Next.js 16 deprecated it
Add a sizes value to responsive images so phones do not download desktop files
Write alt text that describes the image in plain words
Load fonts with next/font so they are self-hosted and do not shift the layout
Load chat widgets, heavy third-party tags with next/script and the lazyOnload strategy
Keep client components small and low in the component tree so less JavaScript ships
Check real user data in the Core Web Vitals report in Search Console
If scores stay red after these fixes our guide on improving page load time covers hosting and caching and CDN changes.
Step 9: Handle Redirects and Status Codes
Clean URLs and correct status codes stop search engines from wasting time on dead or duplicate pages. Use redirects in next.config for moved pages and notFound() for missing content.
// next.config.ts
import type { NextConfig } from 'next'
const nextConfig: NextConfig = {
async redirects() {
return [
{ source: '/old-blog/:slug', destination: '/blog/:slug', permanent: true },
]
},
}
export default nextConfig
When permanent is true Next.js sends a 308 status. Google treats a 308 as a permanent redirect in the same way as a 301.
URL Checklist
Pick www or non-www and redirect the other version at the host level
Keep one trailing slash style everywhere since Next.js removes trailing slashes by default
Use the same URL style in canonicals, the sitemap and internal links
Use permanent redirects for moved pages and keep them live for at least a year
Point old URLs straight to the final page so you never build redirect chains
Call notFound() for missing posts and products so they return a real 404
Build a helpful not-found page with links to your main sections
Use proxy.ts only for redirects that need request data like cookies or headers since Next.js 16 renamed middleware.ts to proxy.ts
Old URLs that return thin pages can show up as soft 404s in Search Console. Our guide on fixing soft 404 errors explains when to use a 404, a 410 or a redirect.
Step 10: Add hreflang for Multi-Language Sites
Skip this step if your site uses one language. If you serve more than one language or region hreflang tells Google which version to show to which user. Next.js builds these tags from alternates.languages in your metadata.
// app/en/pricing/page.tsx
import type { Metadata } from 'next'
export const metadata: Metadata = {
alternates: {
canonical: '/en/pricing',
languages: {
'en-US': '/en/pricing',
'ar-AE': '/ar/pricing',
'x-default': '/en/pricing',
},
},
}
Multi-Language Checklist
Give each language its own URL such as /en/ and /ar/
List every version on every version including the page itself
Add an x-default for users who match none of your languages
Keep each language page canonical to itself and not to the English page
Set the lang attribute on the html tag for each language
Use page tags or sitemap alternates because one method is enough
Step 11: Prepare Pages for AI Overviews and Chat Answers
Google says AI Overviews and AI Mode have no extra technical requirements. A page must be indexed and eligible to show with a snippet. Other AI tools add one more need because many of them read raw HTML without running scripts. Steps 1 to 10 cover the technical side, the rest depends on how you write and structure each page.
AI Visibility Checklist
Answer the main question in the first two sentences under each heading
Use headings that match the questions people really ask
Keep paragraphs short, use lists, tables for steps and comparisons
Show the author, the published date and the updated date
Keep your business name, address and phone number the same across the web
Allow the AI search bots you want traffic from in robots.txt
Avoid nosnippet on pages you want quoted since Google applies snippet controls to AI features too
Treat llms.txt as optional because Google Search ignores it
Search Console now has a setting that controls whether your site appears in Google's generative AI features. It also shows which pages earn impressions in AI Overviews and AI Mode. Teams that want help with this layer often add AI search optimization to their SEO plan.
Step 12: Test Everything Before Launch
Run these checks on a production build before you switch DNS. The dev server behaves differently from a real build so always test the real thing.
Pre Launch Tests
Run next build, fix every error and warning
View the source of key pages and confirm the title, description, canonical and main text are there
Run curl -I on key URLs and check for a 200 status and no stray noindex header
Crawl the site with a tool like Screaming Frog to find broken links and missing tags
Test structured data with the Rich Results Test
Run PageSpeed Insights on mobile for the home page and one page of each template
Open /sitemap.xml, /robots.txt, confirm they list live URLs and not localhost
Paste a page link into a chat app to preview the share image
For a deeper review work through our technical SEO audit checklist which covers 47 issues from crawling to AI crawler access.
Step 13: Track Results After Launch
Tracking shows whether the setup works. Turn it on at launch so your data is clean from day one.
Tracking Setup
Verify a domain property in Google Search Console
Submit the sitemap and watch the Pages report for errors
Check which pages earn impressions in AI Overviews and AI Mode
Add the site to Bing Webmaster Tools since Bing results also feed Microsoft Copilot
Install GA4 with next/script or the @next/third-parties package
Mark form fills, calls and purchases as key events
Send real user Core Web Vitals to analytics with the useReportWebVitals hook
Review clicks and rankings for your main pages every month
Our step-by-step GA4 setup guide covers key events and linking Search Console.
Step 14: Keep the Setup Healthy
SEO setup needs regular checks after launch. New pages, package updates and content edits can break things that worked on day one.
Monthly Upkeep
Update Next.js often since the team now ships security releases on a set schedule
Check Search Console for new indexing errors after every big release
Re-test speed after you add scripts or widgets
Refresh old posts and change the updated date only when the content really changes
Make sure every new template sets its own metadata
Review robots.ts when new AI crawlers appear
If your team has no time for this a website maintenance and security plan covers updates, backups and monitoring.
Common Next.js SEO Mistakes
Most problems we find on Next.js sites come from the same short list.
Mistakes to Avoid
Setting metadataBase to a staging or vercel.app domain so every canonical points to the wrong site
Fetching the main text in useEffect so AI crawlers see an empty page
Reusing one title and description on every page
Shipping a sitemap full of redirects and 404s
Letting a staging site get indexed
Blocking /_next/ in robots.txt
Adding noindex to a page that robots.txt also blocks
Marking up content that does not appear on the page
Using buttons for navigation instead of real links
Conclusion
A strong Next.js SEO setup rests on a few habits. Send real HTML and give every page its own tags. Keep your sitemap and robots rules accurate and add structured data that matches the page. Use the built-in image, font, script tools and keep staging copies out of search. Then test before launch and track results after it.
AI search makes this more urgent because many AI crawlers only read what your server sends. A page that works for them also works for Google. Most of this is quick to build into a new project and slow to fix on a live site that is already losing traffic. Run this checklist on every build and run it again after every major update.
FAQ
1. What is Next.js SEO?
Next.js SEO is the setup that helps search engines, AI tools crawl a Next.js site, understand it and rank it. It covers how pages render and what tags they carry. It also covers sitemaps, robots rules, structured data and speed. Most of the tools you need are built into the App Router.
2. Is Next.js good for SEO?
Yes. Next.js renders pages on the server by default so bots get full HTML on the first visit. It also has built-in tools for metadata, sitemaps, images and fonts. A Next.js site can still rank poorly when those tools are skipped or the content is weak.
3. Do I need an SEO package for Next.js?
Most sites do not. The App Router includes the Metadata API, file conventions for sitemap.xml, robots.txt and Open Graph images. Older Pages Router projects often used packages like next-seo. New projects can do the same work with built-in features.
4. How do I add a canonical URL in Next.js?
Set metadataBase in your root layout. Then add alternates.canonical to the metadata or generateMetadata of each page. Next.js turns the path into a full URL and writes the canonical link tag in the head.
5. Where do sitemap.ts and robots.ts go?
Both files go in the root of the app folder. Next.js serves them at /sitemap.xml and /robots.txt. Large sites can split the sitemap with generateSitemaps or add extra sitemap files inside route folders.
6. Can Google index client-side rendered content in Next.js?
Google can render JavaScript so it often indexes client-side content. The rendering can happen later than the first crawl. Many AI crawlers do not run JavaScript at all. Render your main content on the server so every bot gets it on the first visit.
7. Should I block AI crawlers on my Next.js site?
It depends on your goals. Search bots like OAI-SearchBot, Claude-SearchBot and PerplexityBot help your pages appear in AI answers. Training bots like GPTBot and ClaudeBot collect content for models. You can allow the search bots and block the training bots with separate rules in robots.ts.
8. Do I need an llms.txt file?
Not for Google. Google says its search ignores llms.txt and that AI features need no special files. Some sites still publish one for AI agents, coding tools and Next.js does this for its own docs. Treat it as an optional extra.
9. Is FAQ schema still worth adding in 2026?
It no longer creates a rich result in Google. Google stopped showing FAQ rich results on May 7, 2026. The FAQPage type is still valid and does no harm. Add it only to pages with a real question, answer section and do not expect a visual change in search.
10. How do I check if my Next.js site is ready for SEO?
View the page source and confirm the title, description, canonical and main text are there. Run curl -I to check status codes and headers. Test a few URLs with the URL Inspection tool in Search Console. Then run PageSpeed Insights and the Rich Results Test.
About the author

Sr. SEO Executive · 3 years' experience
Harsh Rajput is a Senior SEO Executive with 3+ years of experience in SEO, digital marketing and AEO/GEO strategy. He leads a team of SEO executives at Digisutra Solutions, handling keyword research, technical SEO, on-page/off-page optimization, link building and content strategy, while helping brands rank in Google AI Overviews and LLM platforms like ChatGPT, Claude and Gemini. He has worked with clients across India, USA, UAE, and Australia in industries like e-commerce, finance and technology.
Reader reviews

Up next · Web & design · 17 min
Website Trust Signals That Build Buyer Confidence in UAE

Related · Web & design · 18 min
Website Animation Design Services in UAE: Fast and Smooth
