Metadata API
The Next.js way to set a page's title, description, OpenGraph and other head tags by exporting a metadata object or generateMetadata function.
In more detail
Layouts and pages can both export metadata; child values are merged over parent ones. Next.js turns them into the right meta and link tags in the document head.
Example
export const metadata = { title: 'Pricing', description: 'Plans and prices' };Related terms
- generateMetadata — An async function a page or layout exports to build its metadata from route params or fetched data.
- meta tag — An HTML tag in the head that describes the page to browsers, search engines and social sites, such as its description.
- Open Graph — A set of meta tags, started by Facebook, that tells social sites what title, description and image to show when a link is shared.
- SEO — Search engine optimisation: making pages easy for search engines to find, understand and rank.
Taught in
- Metadata API: Dynamic OpenGraph & Head Management — Next.js 15 & Modern App Router Architecture