Skip to content
SEWWA

Schema guides Platform

How to add schema to Next.js

Category: framework

Plugins and apps

Manual implementation

App Router: layout.tsx or page.tsx with `<script type="application/ld+json">` built server-side; Pages Router: `_document` or per-page Head.

Troubleshooting

Overview

Next.js should emit JSON-LD on the server for the HTML crawlers receive. In the App Router, colocate schema with the route segment that owns the data (e.g. product loader).

Use JSON.stringify of a plain object; avoid injecting user HTML. SEWWA generates starter graphs you can paste into server components.

Try the free Schema Generator →