How to fix missing schema webpage on Next.js

Add WebPage schema markup to every page so search engines and AI answer engines can precisely understand and describe your content.

Steps for Next.js

  1. Create a reusable `SchemaMarkup` component at `components/SchemaMarkup.tsx` that accepts `WebPage` and `Organization` JSON-LD props and renders them via a Next.js `<Script>` tag (or a plain `<script>` inside the component) with `type='application/ld+json'`.
  2. Populate the `Organization` schema once with your brand's canonical details (name, URL, logo, sameAs social profiles) — ideally sourced from a central `lib/config.ts` constants file so they never go out of sync.
  3. For the `WebPage` schema, pass per-page values (`name`, `description`, `url`, `breadcrumb`, `dateModified`) as props. In the App Router fetch these from `generateMetadata` data so they share the same fetch; in the Pages Router pass them as `getStaticProps`/`getServerSideProps` return values.
  4. In the *App Router* (`app/`): import `SchemaMarkup` inside every `page.tsx` (or in `app/layout.tsx` for the global `Organization` block) and render it directly in the JSX — Next.js serialises it into the `<head>` automatically.
  5. In the *Pages Router* (`pages/`): import `SchemaMarkup` into `pages/_app.tsx` for the `Organization` block and into each individual page component for the `WebPage` block, or use `next/head` inside the component if you prefer inline `<Head>` management.
  6. Validate the output with Google's Rich Results Test and Schema.org's validator, then confirm the `<script type='application/ld+json'>` tags appear in `view-source` before caching/CDN layers to ensure crawlers see them.
Official Next.js documentation ↗

What is missing schema webpage?

Schema markup is a small block of invisible, structured code you add to a web page that tells search engines and AI systems exactly what the page is — its title, description, URL, and type. The `WebPage` schema type is the foundational label that says "this is a web page, here is its name, here is what it's about." Without it, search engines and AI tools have to guess this information by reading your page like a human would, which is less reliable. Think of it like a name tag for your page that any machine can instantly read.

Adding `WebPage` schema directly supports Answer Engine Optimization (AEO) — the emerging discipline of making your content eligible to be quoted or cited by AI assistants like Google's AI Overviews, ChatGPT, and Bing Copilot. AI systems rely heavily on structured data to identify authoritative, trustworthy sources to pull answers from; a missing `WebPage` schema means your pages are less likely to be chosen. It also strengthens your baseline for rich results eligibility and helps Google correctly index and understand every page on your site, which supports rankings and organic traffic. For ecommerce stores in particular, this can mean more product pages, category pages, and content pages surfacing in both traditional search results and AI-generated answers.

See the complete Missing schema webpage guide for every platform and the full background.

Not sure if your Next.js store has this?

Run a free SEOLZ scan — we’ll find missing schema webpage and every other issue across your whole site.

Scan my site free

Fix missing schema webpage on another platform