AVAILABLE FOR WEB, FLUTTER & QA PROJECTS
How to use this tool
1. Specify Page Details
Enter page title, meta description, canonical path, and Open Graph image URLs.
2. Choose Mode
Select Static Metadata (`export const metadata: Metadata`) or Dynamic Metadata (`export async function generateMetadata(...)`).
3. Configure Robots & Social
Toggle index/follow directives, Open Graph types (website/article), and Twitter card formats.
4. Copy TypeScript Snippet
Export clean, typed Next.js code formatted for modern App Router page.tsx and layout.tsx files.
Formula or logic used
Next.js App Router Metadata Composition
Next.js merges metadata fields shallowly across the route tree, inheriting from layout.tsx and overriding specific properties in page.tsx.
title.template: Use `%s | Brand` in root layout for automatic branding across nested pages.title.absolute: Use absolute titles in leaf pages when overriding root layout templates.alternates.canonical: Always declare absolute HTTPS canonical URLs to avoid duplicate content penalties.metadataBase: Define `metadataBase: new URL('https://domain.com')` in root layout to resolve relative OG images.
Examples
Example 1: Standard Static Blog Post Metadata
Statically evaluated at build time for instant server-rendered HTML delivery.
Example 2: Dynamic E-Commerce Product Metadata
Executes in parallel with page data fetching, preventing waterfall delays.
Common use cases
Next.js 13/14/15 App Router Migrations
Convert legacy `next/head` tags into official App Router Metadata API objects.
Dynamic Product & Article Metadata
Scaffold `generateMetadata` functions with dynamic database queries and fallback fallbacks.
SEO Title Template Standardization
Enforce consistent brand suffixes and character boundaries across client web apps.
Social Share Card Configuration
Ensure Open Graph and Twitter Card tags render perfectly across social platforms.
Related tools
View All Tools Directory →Next.js Sitemap Generator
The Next.js Sitemap Generator constructs idiomatic `app/sitemap.ts` code for the Next.js App Router, combining...
Next.js Robots.txt Generator
The Next.js Robots.txt Generator creates type-safe `app/robots.ts` files for the Next.js App Router, managing ...
Open Graph Preview Checker
The Open Graph Preview Checker inspects social metadata tags and renders real-time, pixel-accurate preview car...
Frequently asked questions
Where should metadata be declared in Next.js?
Metadata can only be exported from Server Components inside `layout.tsx` or `page.tsx` files. Client components (`'use client'`) cannot export metadata.
What is the difference between static metadata and generateMetadata?
Static metadata uses `export const metadata: Metadata = {...}` and is defined at build time. `generateMetadata` is an async function that receives route parameters and search queries to fetch data dynamically.
Why should I define metadataBase in the root layout?
`metadataBase` defines the base URL for resolving relative image and canonical paths in Open Graph tags, ensuring social platforms always receive absolute HTTPS URLs.
Can I use next/head in Next.js App Router?
No. The `next/head` component from Pages Router is not supported in App Router. You must use the built-in Metadata API instead.
Let's build something
exceptional together
Work directly with Faisal Rafique to architect and deliver high-performance Next.js 15 platforms, 60fps Flutter mobile applications, and enterprise automated QA testing pipelines.