---
title: "Question Schema"
description: "Use defineQuestion() to add Question and Answer structured data and connect QAPage or FAQPage mainEntity references."
canonical_url: "https://unhead.unjs.io/docs/typescript/schema-org/api/schema/question"
---

> Index of every page on this site: [llms.txt](https://unhead.unjs.io/llms.txt)

## Schema.org Question

- **Type**: `defineQuestion<T extends Record<string, any>>(input?: Question & T)`{className="language-ts shiki shiki-themes github-light-high-contrast github-light-high-contrast github-dark-high-contrast" language="ts" style=""}  
Describes an individual question on a `QAPage` or an `FAQPage`.

<note>

Google stopped showing FAQ rich results on May 7, 2026. `FAQPage` markup stays valid Schema.org. Google still uses `Question` for [Q&A pages](https://developers.google.com/search/docs/appearance/structured-data/qapage){rel="[\"nofollow\"]"} and [Education Q&A](https://unhead.unjs.io/docs/schema-org/api/schema/quiz). See the [FAQ recipe](https://unhead.unjs.io/docs/schema-org/guides/recipes/faq) for details.



</note>

## Useful Links

- [Schema.org Question](https://schema.org/Question){rel="noopener noreferrer" target="_blank"}
- [QAPage - Google Search Central](https://developers.google.com/search/docs/appearance/structured-data/qapage){rel="[\"nofollow\"]"}
- [Recipe: FAQ](https://unhead.unjs.io/docs/schema-org/guides/recipes/faq)

## Question and answer properties

- **name** `string` or **question** `string`  
The text content of the question.
- **acceptedAnswer** `string | Answer` or **answer** `string`  
The text content of the answer.

## Examples

### Minimal

```ts
defineQuestion({
  name: 'What is the meaning of life?',
  acceptedAnswer: '42',
})
```

## Defaults

- **@type**: `Question`
- **@id**: `${canonicalUrl}#/schema/question/{n}`
- **inLanguage**: `inLanguage` from resolved page metadata *(see: [Schema.org Params](https://unhead.unjs.io/docs/schema-org/guides/core-concepts/params))*

## Resolves

See [Global Resolves](https://unhead.unjs.io/docs/schema-org/guides/get-started/overview#how-does-schemaorg-get-page-data) for full context.

- converts the `question` alias to `name` and the `answer` alias to `acceptedAnswer`
- converts a string answer to an [Answer](https://schema.org/Answer){rel="noopener noreferrer" target="_blank"} object
- assigns numbered IDs in registration order when `@id` is not provided
- serializes `dateCreated` Date objects as ISO 8601 strings

## Relation Transforms

[WebPage](https://unhead.unjs.io/docs/schema-org/api/schema/webpage)

- Each question appends an entry to `mainEntity` when the WebPage includes the `FAQPage` or `QAPage` type

## Types

```ts
/**
 * A specific question, e.g., from a user seeking answers online or collected in a Frequently Asked Questions (FAQ) document.
 */
export interface QuestionSimple extends Thing {
  /**
   * The text content of the question.
   */
  name?: string
  /**
   * An answer object, with a text property which contains the answer to the question.
   */
  acceptedAnswer?: NodeRelation<Answer | string>
  /**
   * The language code for the question; e.g., en-GB.
   */
  inLanguage?: string
  /**
   * The number of answers provided for this question.
   */
  answerCount?: number
  /**
   * The date and time the question was created.
   */
  dateCreated?: ResolvableDate
  /**
   * Alias for `name`
   */
  question?: string
  /**
   * Alias for `acceptedAnswer`
   */
  answer?: string
}

/**
 * An answer offered to a question; perhaps correct, perhaps opinionated or wrong.
 */
export interface AnswerSimple extends Thing {
  text: string
}

export interface Answer extends AnswerSimple {}
```

## Related Schemas

- [Person](https://unhead.unjs.io/docs/schema-org/api/schema/person): Question author
- [Article](https://unhead.unjs.io/docs/schema-org/api/schema/article): Related article

## Sitemap

See the full [sitemap](https://unhead.unjs.io/sitemap.md) for all pages.
