Structured data for AI answers in Next.js

Which schema.org types are worth adding, what they do and don't do for AI search, and how to add JSON-LD in the Next.js App Router.

Short answer

Add JSON-LD for who you are (Organization), what each page is (Article, Product, SoftwareApplication) and who wrote it, with dates. It won't get you into AI answers on its own, but it removes guesswork about who published what and when.

What's worth adding#

Page Type Key properties
Home Organization, WebSite name, url, logo, sameAs
Article or guide Article headline, author, datePublished, dateModified
Product or app Product or SoftwareApplication name, offers, applicationCategory
Any nested page BreadcrumbList the path back to the home page

Keep it honest. Structured data that doesn't match what's visible on the page can be treated as spam.

Test your own siteSee which AI crawlers your site lets in and what else stops them quoting you.

Adding it in Next.js#

Next.js recommends rendering JSON-LD as a script tag in the page itself:

export default async function Guide({ params }) {
  const { slug } = await params
  const guide = await getGuide(slug)
  const jsonLd = {
    '@context': 'https://schema.org',
    '@type': 'Article',
    headline: guide.title,
    datePublished: guide.published,
    dateModified: guide.updated,
    author: { '@type': 'Person', name: guide.author },
  }
  return (
    <article>
      <script
        type="application/ld+json"
        dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd).replace(/</g, '\\u003c') }}
      />
      <h1>{guide.title}</h1>
    </article>
  )
}

The replace escapes < so content can't break out of the script tag.

Check it#

Google's Rich Results Test validates the markup. Our checker reports which types it finds and whether any block fails to parse.

Questions

Do I need special schema for AI Overviews?

No. Google's guide to its AI search features says no special schema is required. Standard structured data helps Google understand the page, the same as for regular search.

Do FAQPage rich results still show in Google?

Since 2023 Google shows FAQ rich results only for well-known government and health sites. The markup is still valid and describes the page, but don't expect the rich result.

Should JSON-LD be in the head or body?

Either works. In Next.js the simplest place is a script tag inside the page component.

Related guides