Skip to content
Sagar Bharvadiya

5 min read

Technical SEO checklist for a Next.js website

A practical Next.js technical SEO checklist covering metadata, canonical URLs, dynamic sitemaps, schema markup, and rendering to protect search traffic.

Sagar Bharvadiya, Next.js developer, smiling with arms crossed

By · Published

Next.jsTechnical SEOWeb Development
Cover illustration for “Technical SEO checklist for a Next.js website”

When businesses rebuild their websites on modern frameworks, search engine optimization is often treated as an afterthought. Many teams assume that switching to a fast framework like Next.js guarantees top search rankings automatically. While modern frontend tooling offers enormous technical advantages, poor configuration can quietly wipe out years of organic traffic.

Search engines crawl websites using automated bots that evaluate structure, discoverability, and speed. If your pages rely too heavily on client-side rendering or lack proper meta definitions, web crawlers may encounter empty HTML shells or duplicate URLs. In my client builds, setting up a rock-solid technical SEO foundation is just as critical as creating smooth UI interactions.

This practical checklist covers the essential technical SEO requirements for Next.js projects. Whether you are launching a product marketing site or migrating an existing corporate domain, following these steps ensures Google indexes your content reliably.

Rendering strategies: why SSR and SSG matter for crawlers

Server-Side Rendering (SSR) and Static Site Generation (SSG) ensure search engine crawlers receive complete, populated HTML files on their initial request. While search bots have improved at executing client-side JavaScript, waiting for scripts to run in the crawler browser wastes crawl budget and delays indexing.

Using React Server Components in the Next.js App Router renders your page content on the server before transmitting it across the network. Crawlers immediately see your headlines, body copy, and internal links without running a single line of client code. This architecture also directly improves your performance metrics, which we explore in our guide on Core Web Vitals explained.

Avoid using client-side data fetching libraries for content that you expect search engines to index. Restrict client components to interactive elements such as modal dialogs, calculators, and search filters, while keeping main page copy inside server-rendered components.

  • Pre-render public marketing pages using Static Site Generation whenever content does not change per user.
  • Use Server-Side Rendering or Incremental Static Regeneration for high-frequency dynamic catalogs.
  • Reserve client-side rendering solely for user-authenticated dashboards or private workflows.

Dynamic metadata: managing titles and descriptions in App Router

Next.js provides a native Metadata API in the App Router that cleanly separates document head configuration from your page markup. You can define static metadata objects on layout files or export an asynchronous generateMetadata function to fetch page details dynamically.

Every single indexable page on your site must have a unique title tag and descriptive meta description. Duplicated titles confuse search engines about which page should rank for a specific keyword phrase. When managing titles across multiple subpages, use the title template property in your root layout to maintain consistent brand naming across the domain.

Open Graph tags and Twitter card parameters must also be populated alongside standard search tags. When someone shares your page on LinkedIn or Slack, these tags determine the image preview, headline, and summary displayed to potential visitors.

Canonical URLs: stopping duplicate content issues

A canonical URL explicitly tells search engines which version of a page represents the authoritative source. E-commerce filtering, campaign tracking parameters (like UTM tags), and trailing slashes can easily cause the same page content to appear under several distinct web addresses.

Without proper canonical tags, Google might split ranking authority between duplicate URLs or index an unwanted parameter string. Inside your root metadata configuration, declare a metadataBase URL to set the primary domain format across the site. Next.js then constructs absolute canonical URLs automatically for every child route.

Ensure your server enforces strict trailing slash consistency. Whether your team prefers trailing slashes or clean paths, picking one pattern and redirecting the other prevents duplicate indexing issues.

XML sitemaps and robots.txt: helping crawlers navigate your site

An XML sitemap acts as a roadmap for search engines, listing all valid, indexable pages and their recent modification dates. Instead of relying on manual XML files that quickly become outdated, Next.js allows you to generate dynamic sitemaps programmatically.

By creating a sitemap.ts file inside your app folder, you can query your content database and return an array of routes in real time. On a new Next.js and Sanity website, this file fetches published slugs directly from the CMS API, ensuring newly created landing pages get added to the sitemap immediately.

Similarly, you should configure a robots.ts file to define crawling rules. This file instructs automated bots which directories to scan and explicitly points them to your primary XML sitemap location.

  • Automate sitemap generation to reflect published CMS entries without manual developer updates.
  • Exclude private preview pages, checkout flows, and internal staging environments from search indexing.
  • Define your sitemap location directly inside robots.txt using an absolute domain path.

Structured data: adding clean JSON-LD for rich snippets

Structured data provides explicit contextual clues about your business, articles, products, and FAQs using standardized schema markup. Adding this data helps search engines display rich snippets, such as review stars or expandable FAQ accordions, right on the search results page.

In Next.js, the most reliable way to implement structured data is through JSON-LD script tags embedded directly within Server Components. You format your data as a clean JavaScript object, convert it to a string with JSON.stringify, and inject it into a script tag with the type application/ld+json.

Always validate your structured data output using Google's Rich Results Test tool before shipping to production. Broken schema syntax can cause Google to ignore the markup entirely.

Managing 301 redirects and HTTP status codes

Permanent 301 redirects preserve accumulated SEO ranking power whenever you alter a page path or migrate old URLs. Failing to map legacy links during a platform rebuild leads to broken 404 errors, causing search rankings to decline rapidly.

In Next.js, straightforward redirects should be declared inside your next.config.js configuration file under the redirects key. These rules run before incoming requests reach framework routing logic, delivering fast responses and proper 301 HTTP status headers.

For websites with thousands of legacy paths or dynamic editorial redirects, Next.js Middleware can query an external lookup table or CMS dataset. This approach handles URL restructuring without bloating your core build configuration.

Practical takeaways for your next launch

Technical SEO is not a single plugin you install; it is an architectural discipline that runs through your entire Next.js codebase. Establishing these foundational rules early avoids messy rescue projects after your site has already gone live.

Before launching any public-facing build, audit your server rendering, inspect output HTML source code, confirm your sitemaps update automatically, and test schema markup. Taking care of these technical requirements allows your editorial content and design to gain the search visibility they deserve.

Want help with this? See my New Next.js + Sanity website service, or send me your site for a free review.

Frequently asked questions

Is Next.js good for SEO out of the box?
Next.js provides excellent foundational tools for SEO like Server Components and built-in metadata management. However, you must still configure page titles, canonical tags, sitemaps, and structured data correctly to achieve strong search visibility.
How does Next.js handle XML sitemaps for dynamic routes?
Next.js allows developers to create a dynamic sitemap.ts file in the app directory. This file fetches published slugs directly from an API or headless database at build time or request time, outputting a standard XML feed automatically.
Does Googlebot render client-side JavaScript in Next.js?
Googlebot can execute client-side JavaScript, but rendering requires a two-wave indexing process that consumes crawl budget and delays indexing. Using Server-Side Rendering (SSR) or Static Site Generation (SSG) serves plain HTML immediately, ensuring your content is parsed without delay.
Where should 301 redirects be configured in Next.js?
Permanent 301 redirects are best handled inside next.config.js for static path migrations, or inside Next.js Middleware if you need dynamic redirects driven by CMS lookups.

Need this done for you?

WordPress → Next.js + Sanity migration · from $1,500

Leave plugin updates behind. Keep your content, URLs and Google rankings. See the service →

Is your site slow? Test it free on mobile and see the top 3 problems in 30 seconds.Free speed test

Keep reading

Free site review

Send me your link. I’ll tell you the first 3 things I’d fix.

No call needed, no obligation. Replies within 4 hours, with a rough estimate.