---
name: seo-audit
description: "Audit a Next.js App Router app for the SEO layer that Next.js turns into head tags and crawler files. Use before launch, or after adding routes, to confirm metadataBase and a title template in the root layout, a canonical URL on every indexable page, Open Graph and a social image, a typed sitemap.ts and robots.ts, JSON-LD for rich results, and no page missing an intentional title or description. Metadata in the App Router is typed exports, so most of this is checkable, not guesswork."
---

# SEO Audit

The SEO pass before launch: metadataBase and a title template, a canonical on every page, an OG image, sitemap and robots, and JSON-LD. Next.js makes metadata typed exports, so this checks the ones you forgot.

## Phases

Work through these in order.

### 1. Defaults

Confirm the root layout sets metadataBase (absolute URLs) and a title.template with a default, so every new route inherits the brand suffix and social defaults instead of shipping bare.

Read: [seo](https://selwynuy.dev/d/seo.md)

### 2. Per-page

Confirm every indexable page has an intentional title and description and an explicit alternates.canonical, and that dynamic routes use generateMetadata (awaiting params) with a cached data call, not a static object.

Read: [seo](https://selwynuy.dev/d/seo.md)

### 3. Crawlers and cards

Confirm sitemap.ts and robots.ts exist and are typed, an Open Graph image resolves (static or generated), and JSON-LD is present where rich results apply. Remember robots.txt is not access control; gate private routes with real auth.

Read: [seo](https://selwynuy.dev/d/seo.md), [performance](https://selwynuy.dev/d/performance.md)

## Bundled files

- `scripts/scan-seo.mjs` (script): Scans the app/ tree for metadataBase, a title template, canonical usage, sitemap/robots files, and OG images, and flags routes that look unconfigured for review.
- `references/seo-checklist.md` (reference): The full typed-metadata SEO layer with the fix for each gap, sourced to the Next.js metadata docs and the handbook's SEO page.

---

Part of SEO Audit from Selwyn Uy's Next.js Handbook. Full page: https://selwynuy.dev/skills/seo-audit
