Free auditStart free
GuideNext.js · Search listings

Next.js title and meta description

Set static or data-driven metadata in the App Router, compose title templates, and inspect the HTML Google receives.

3 min
read
5
sources
Oct 24, 2026
updated
Scaplet Editorial Team
author
In one line

In the Next.js App Router, export a metadata object from a layout.js or page.js file for static titles and descriptions. Use generateMetadata when the values depend on route data, such as a product or article slug. Set a title template in the layout, override it on individual pages, and inspect the rendered HTML to catch missing or duplicate values.

30-second check

Where does your site stand?

Four quick questions, then a straight answer.

1/4Have you checked your own site for this?
Summarize this page withChatGPTClaudePerplexityGoogleAI Mode
02Checklist

Generate metadata from route data

Use generateMetadata when metadata depends on route parameters, fetched content, or a parent segment. Fetch the same canonical content record the page uses to render its heading and body. If the record is missing, return the correct not-found behavior rather than emitting a generic title that suggests the page exists. The example uses Next.js 15 and later, where dynamic route params are asynchronous; Next.js 14 and earlier use a synchronous shape. Check the docs for your installed version before copying it.
First2
Use a description field written for search snippets, not an unedited database dump.
Do not include stock or price claims unless they stay accurate and appear on the page.
Next1
For localized routes, write metadata in the same language as the page and use route-specific values.
Then1
Keep a fallback for optional CMS fields so undefined does not turn into a blank or boilerplate tag.
Dynamic product metadata
import type { Metadata } from "next"

export async function generateMetadata({
  params,
}: { params: Promise<{ slug: string }> }): Promise<Metadata> {
  const { slug } = await params
  const product = await getProduct(slug)

  return {
    title: `${product.name} | Example`,
    description: product.searchSummary,
  }
}
03How it works

Check the output Google sees

  1. 1

    Inspect the production HTML

    Open a representative static and dynamic route. Check its <title>, description meta tag, H1, and canonical in the public HTML response.

  2. 2

    Check route coverage

    Sample records with the shortest and longest names, a missing summary, and a non-default locale. Make sure every route has a distinct, accurate title and useful description.

  3. 3

    Review title rewrites

    Google generates title links from the title element, prominent headings, visible page text, and other sources. Align those sources when Google selects different wording.

  4. 4

    Treat snippets as previews

    Google primarily generates snippets from page content and may use your meta description when it better describes the page for the query. Make the first visible content answer the same intent.

For URL-level metadata, see Next.js canonical tags. For crawl discovery, see Next.js XML sitemaps and Google’s title link guidance.

Sources · 5

Every fact, linked and dated.

Official docs first. The date is when we last opened each page.
  • nextjs.org
  • google.com
  1. 01generateMetadata | Next.js Documentationnextjs.org · checked 2026-10-24
  2. 02generateMetadata | Next.js 14 Documentationnextjs.org · checked 2026-10-24
  3. 03generateMetadata | Next.js 15 Documentationnextjs.org · checked 2026-10-24
  4. 04Influencing title links in Google Search | Google Search Centraldevelopers.google.com · checked 2026-10-24
  5. 05Control your snippets in search results | Google Search Centraldevelopers.google.com · checked 2026-10-24
Questions

Asked a lot.

3 questions people ask next, answered from the sources on this page.

01How do I add a meta description in Next.js?

In the App Router, export metadata with a description field from a layout.js or page.js. Use generateMetadata when the value depends on route data.

02Should title templates go in a page or layout?

Use a layout for the shared title template and set a distinct title on pages that need one. Inspect the final rendered title after metadata is merged across layouts.

03Why is my Next.js title missing in Google?

Check the deployed page HTML first, then compare the title with the visible heading and content. Google may generate another title link, and it has to recrawl and reprocess the page to notice changes, which Google says can take a few days to a few weeks.

Free · 2 minutes

Tools point. Agencies advise. This one ships.

Run the free audit, then approve the fixes. Every change can be undone.

Free, no card60 secondsNobody will call you
  • 46 fixes shipped without a ticket Brightpipe
  • 0→7 ChatGPT citations in six weeks Paylane