# 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.

Canonical: https://scaplet.com/seo/nextjs/title-and-meta

Guide Next.js · Search listings

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 with [ChatGPT](https://chatgpt.com/?hints=search&q=Summarize%20https%3A%2F%2Fscaplet.com%2Fseo%2Fnextjs%2Ftitle-and-meta%20(%22Next.js%20title%20and%20meta%20description%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Claude](https://claude.ai/new?q=Summarize%20https%3A%2F%2Fscaplet.com%2Fseo%2Fnextjs%2Ftitle-and-meta%20(%22Next.js%20title%20and%20meta%20description%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Perplexity](https://www.perplexity.ai/search?q=Summarize%20https%3A%2F%2Fscaplet.com%2Fseo%2Fnextjs%2Ftitle-and-meta%20(%22Next.js%20title%20and%20meta%20description%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [![Google](/logos/ai/google-color.svg)AI Mode](https://www.google.com/search?udm=50&q=Summarize%20https%3A%2F%2Fscaplet.com%2Fseo%2Fnextjs%2Ftitle-and-meta%20(%22Next.js%20title%20and%20meta%20description%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.)

On this page

## 3 parts, 3 minutes.

1. [Set static metadata in the App Router 01](#set-static-metadata-in-the-app-router)
2. [Generate metadata from route data 02](#generate-metadata-from-route-data)
3. [Check the output Google sees 03](#check-the-output-google-sees)

_01_Pick the API that matches the page

## Set static metadata in the App Router

Next.js lets a `layout.js` or `page.js` export the `metadata` object. Put site-wide defaults and a title template in the root layout, then set page-specific fields where the content is known. Next.js shallowly merges metadata exported from multiple segments and replaces duplicate keys, so check the final output instead of assuming a child file inherits every nested parent field. A title template needs `title.default`, applies only to child segments, and does not apply to a `page.js` in the same segment as the layout that defines it; `title.absolute` ignores a parent template.

Page type

### Static route

Next.js approach

Export `metadata`

Example

About page with a fixed title and description

Page type

### Dynamic product or article route

Next.js approach

Export `generateMetadata` and read route data

Example

Use product name and real inventory or article fields

Page type

### Shared title structure

Next.js approach

Set a `title.template` in a layout and override route titles

Example

`Product name | Store`

app/page.tsx

```
import type { Metadata } from "next" export const metadata: Metadata = { title: "Pricing | Example", description: "Compare plans and choose the right setup for your team.", } export default function Page() { return <main><h1>Pricing</h1></main> }
```

_02_Checklist

## 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.

First_2_
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.

Next_1_
For localized routes, write metadata in the same language as the page and use route-specific values.

Then_1_
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, } }
```

_03_How 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](/glossary/title-tag) 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](/glossary/meta-description) when it better describes the page for the query. Make the first visible content answer the same intent.

**Dynamic metadata can be streamed**Next.js documents that `generateMetadata` is included in initial HTML when a page can be prerendered and the function does not introduce dynamic behavior. Otherwise (streaming support arrived in Next.js 15.2.0) the metadata tags can be appended to the `<body>` after the initial UI. Next.js says it verified that bots that execute JavaScript, such as [Googlebot](/ai-crawlers/googlebot), interpret this correctly, and that HTML-limited bots such as `facebookexternalhit` still get metadata in `<head>`. Test the deployed response either way.

For URL-level metadata, see [Next.js canonical tags](/seo/nextjs/canonical-tags). For crawl discovery, see [Next.js XML sitemaps](/seo/nextjs/xml-sitemap) and Google’s [title link guidance](/glossary/title-tag).

Sources · 5

## Every fact, linked and dated.

Official docs first. The date is when we last opened each page.

- nextjs.org
- google.com

1. 01 [generateMetadata | Next.js Documentation](https://nextjs.org/docs/app/api-reference/functions/generate-metadata) nextjs.org · checked 2026-10-24
2. 02 [generateMetadata | Next.js 14 Documentation](https://nextjs.org/docs/14/app/api-reference/functions/generate-metadata) nextjs.org · checked 2026-10-24
3. 03 [generateMetadata | Next.js 15 Documentation](https://nextjs.org/docs/15/app/api-reference/functions/generate-metadata) nextjs.org · checked 2026-10-24
4. 04 [Influencing title links in Google Search | Google Search Central](https://developers.google.com/search/docs/appearance/title-link) developers.google.com · checked 2026-10-24
5. 05 [Control your snippets in search results | Google Search Central](https://developers.google.com/search/docs/appearance/snippet) developers.google.com · checked 2026-10-24

Questions

## Asked a lot.

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

_01_ How 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.

_02_ Should 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.

_03_ Why 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.

## Keep learning

[All platform guides](/seo)

[Learn Next.js SEO Frameworks](/seo/nextjs) [Related Meta description On-page SEO](/glossary/meta-description) [Read next Next.js canonical tags Frameworks](/seo/nextjs/canonical-tags) [Do Run a free site audit Free, about two minutes](/site-audit)

Nearby in platform guides
[Nginx custom 404 page](/seo/nginx/404)

More in Next.js SEO
[Next.js 404 page](/seo/nextjs/404) [Next.js AI crawlers](/seo/nextjs/ai-crawlers) [Next.js canonical tags](/seo/nextjs/canonical-tags) [Next.js Google Analytics](/seo/nextjs/google-analytics) [Next.js image SEO](/seo/nextjs/image-seo) [Next.js lazy loading](/seo/nextjs/lazy-loading) [Next.js noindex](/seo/nextjs/noindex) [Next.js redirects](/seo/nextjs/redirects) [Next.js robots.txt](/seo/nextjs/robots-txt) [Next.js structured data](/seo/nextjs/structured-data) [Next.js title and meta description](/seo/nextjs/title-and-meta) [Next.js XML sitemap](/seo/nextjs/xml-sitemap)

Terms on this page
[Title tag](/glossary/title-tag) [Meta description](/glossary/meta-description)

Free · 2 minutes

## Tools point. Agencies advise. _This one ships._

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

[Audit my site free](/site-audit)

Free, no card 60 seconds Nobody will call you

- **46** fixes shipped without a ticket Brightpipe
- **0→7** ChatGPT citations in six weeks Paylane
