---
title: "FAQPage Schema"
description: "Add FAQPage structured data to Sanity documents — enable Google's FAQ rich snippets directly in search results to increase click-through rates and answer user questions instantly."
canonical: https://sanity-plugin-seofields.thehardik.in/docs/schema-org/faq-page
---

# FAQPage

Add FAQPage structured data to your Sanity-powered site with a single plugin. Surface expandable Q&amp;A rich results directly in Google Search.

## About FAQPage

FAQPage schema describes question-and-answer content that is visibly present on the page. It can help search engines and AI answer systems parse concise answers, but rich result display is limited and not guaranteed. Use FAQPage only for genuine FAQ content that users can read on the page.

## Fields

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `mainEntity` | array of objects | Yes | List of Question objects, each with a name (question text) and acceptedAnswer.text (answer text). |
| `mainEntity[].name` | string | Yes | The full text of the question. |
| `mainEntity[].acceptedAnswer.text` | string | Yes | The full text of the answer to the question. |

## Plugin Registration

```typescript
import { defineConfig } from "sanity";
import { schemaOrgFAQPagePlugin } from "sanity-plugin-seofields/schema";

export default defineConfig({
  // ... your project config
  plugins: [
    schemaOrgFAQPagePlugin(),
  ],
});
```

## Schema Usage

Add the `schemaOrgFAQPage` field to any document schema:

```typescript
import { defineField, defineType } from 'sanity'

export default defineType({
  name: 'page',
  title: 'Page',
  type: 'document',
  fields: [
    // ... your other fields
    defineField({
      name: 'schemaOrgFAQPage',
      title: 'FAQ Page Schema',
      type: 'schemaOrgFAQPage',
    }),
  ],
})
```

## GROQ Query

```javascript
const query = groq`*[_type == "page"][0]{
  "faq": schemaOrgFAQPage {
    mainEntity[] {
      name,
      "acceptedAnswer": acceptedAnswer { text }
    }
  }
}`;
```

## Next.js Component

```tsx
import { FAQPageSchema } from "sanity-plugin-seofields/schema/next";

export default function Layout({ children }: { children: React.ReactNode }) {
  // Fetch your FAQ data from Sanity
  const faq = await sanityClient.fetch(query);

  return (
    <html lang="en">
      <body>
        <FAQPageSchema data={faq.faq} />
        {children}
      </body>
    </html>
  );
}
```

## JSON-LD Output

```json
{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "mainEntity": [
    {
      "@type": "Question",
      "name": "What is sanity-plugin-seofields?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "A Sanity plugin that adds SEO and structured data fields to your documents."
      }
    },
    {
      "@type": "Question",
      "name": "How do I install it?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Run npm install sanity-plugin-seofields and add the plugin to your sanity.config.ts."
      }
    }
  ]
}
```
