# Mark up question-and-answer pages with QAPage

- Check 49.02 · User content and forums · Important
- Source: https://checklist-seo-geo.com/en/user-content-forums/mark-up-question-answer-pages-qapage
- Mark up every question page with QAPage: one question per page, accepted and suggested answers, votes, authors, and setup for each forum software.
- Updated on 2026-11-27
- Licence: CC BY 4.0. Credit “Checklist SEO & GEO” with a link to https://checklist-seo-geo.com/en/user-content-forums/mark-up-question-answer-pages-qapage.
- Plugin checklist-seo-geo: 1.3.1 · https://github.com/maximegaul/checklist-seo-geo

## In short

`QAPage` describes a page devoted to a single question that users can answer. The markup identifies the question (`Question`), the accepted answer or answers (`acceptedAnswer`) and the other answers (`suggestedAnswer`), with their votes, authors and dates. Once this check is done, every question page with at least one answer is eligible for Google's Q&A rich result.

## Why it matters

On a help site, the value of a page lies in its best answer. Without markup, Google has to find it on its own among the posts, comments and follow-ups. With `QAPage`, you tell it which answer was accepted, how many answers exist, how many votes each one received and where it sits on the page. Google can then display a rich result showing the top answers, or use the text of an answer in the standard snippet.

The type is reserved for a specific case:

| Page | QAPage? |
|---|---|
| Forum thread where members answer a question | Yes |
| Product support page where users answer a question | Yes |
| FAQ written by the publisher, which visitors cannot answer | No: see [FAQPage and HowTo](https://checklist-seo-geo.com/en/schemaorg-structured-data/implement-faqpage-howto-only-if-relevant) |
| Product page with several questions and answers | No |
| Article, tutorial or essay that answers a question | No |
| Discussion thread with no question and no answers to choose between | No: [DiscussionForumPosting](https://checklist-seo-geo.com/en/user-content-forums/mark-up-discussions-discussionforumposting) |

Google does not ask for both kinds of markup on the same page: a help forum uses `QAPage` on its question threads and `DiscussionForumPosting` on the others.

As for generative engines, no provider documents any use of this markup. An explicit question followed by dated, attributed answers remains a format that is easy to reuse, provided the text is in the HTML.

## What it improves

- **Q&A rich result** in Google, for pages that have at least one answer. Display is not guaranteed.
- **Snippet**: the text of an answer can be used as the snippet even without a rich result.
- **Direct link to the answer** thanks to the `url` property of each `Answer`.
- **Monitoring**: a dedicated report in Search Console, useful for spotting a broken template.
- **Rankings**: no documented direct effect.
- **AI citations**: unproven; the effect comes from the visible content.

## How to check

Count the question blocks in the served HTML: there must be only one.

```bash
curl -s https://example.com/questions/1482/remplacer-joint-mitigeur | grep -o -E '(QAPage|acceptedAnswer|suggestedAnswer|answerCount)' | sort | uniq -c
```

Compliant result: `QAPage` once, `answerCount` once, and as many `acceptedAnswer` or `suggestedAnswer` occurrences as there are answers displayed.

Then test the URL in the Rich Results Test, and check by hand:

1. `answerCount` matches the total number of answers, including those on subsequent pages.
2. The answer marked `acceptedAnswer` is indeed the one the site presents as accepted.
3. Comments under an answer are in `comment`, not in `suggestedAnswer`.
4. The marked-up text is complete and identical to the displayed text: see [align markup with visible content](https://checklist-seo-geo.com/en/schemaorg-structured-data/align-markup-visible-content).

## How to implement

### Before you start

Properties Google expects:

| Item | Property | Status |
|---|---|---|
| `QAPage` | `mainEntity` (the `Question`) | Required, only one per page |
| `Question` | `name` | Required: the short form of the question, usually the title |
| `Question` | `answerCount` | Required: total number of answers, `0` if there are none |
| `Question` | `acceptedAnswer` or `suggestedAnswer` | Required for the rich result: at least one answer |
| `Question` | `text`, `upvoteCount`, `author`, `datePublished`, `dateModified`, `comment`, `commentCount` | Recommended |
| `Answer` | `text` | Required: full text |
| `Answer` | `url` | Strongly recommended: direct link, with an anchor |
| `Answer` | `upvoteCount`, `author`, `datePublished`, `dateModified`, `comment` | Recommended |
| `author` | `name`, `url` | `url` pointing to the profile page on the site, ideally marked up as a [ProfilePage](https://checklist-seo-geo.com/en/schemaorg-structured-data/implement-person-profilepage) |

Rules to follow:

- **`acceptedAnswer`**: the answer must be accepted through a mechanism of the site (the person who asked, a moderator, votes). Sorting by date is not enough. There can be zero, one or several.
- **`upvoteCount`**: upvotes minus downvotes. With no downvotes, the number of upvotes.
- **`answerCount` + `commentCount`** must equal the total number of replies of any type.
- **`digitalSourceType`**: to be set on an answer produced by a bot or a language model; without this property, Google assumes a human author.
- **No markup across the whole site**: only question pages are concerned.

> **Good to know:** a question with no answer is not eligible for the rich result. You can mark it up with `answerCount: 0`, but the real decision is about its indexing: see [control the indexing of empty or thin threads](https://checklist-seo-geo.com/en/user-content-forums/control-indexing-empty-thin-threads).

Complete example:

```json
{
  "@context": "https://schema.org",
  "@type": "QAPage",
  "mainEntity": {
    "@type": "Question",
    "name": "How do I replace the seal on a dripping mixer tap?",
    "text": "My kitchen mixer tap has been dripping from the spout for a week. Do I need to change the cartridge or just the seal, and how do I take it apart without damaging the chrome?",
    "answerCount": 2,
    "upvoteCount": 12,
    "datePublished": "2026-09-14T18:22:00+02:00",
    "author": {
      "@type": "Person",
      "name": "Karim_B",
      "url": "https://example.com/membres/karim-b"
    },
    "acceptedAnswer": {
      "@type": "Answer",
      "url": "https://example.com/questions/1482/remplacer-joint-mitigeur#reponse-3310",
      "text": "A leak at the spout almost always comes from the cartridge. Turn off the water, remove the handle cover, undo the locking screw, then the cartridge nut with an open-end wrench wrapped in a cloth. Replace the cartridge with one of the same diameter.",
      "upvoteCount": 31,
      "datePublished": "2026-09-14T19:05:00+02:00",
      "dateModified": "2026-09-15T08:40:00+02:00",
      "author": {
        "@type": "Person",
        "name": "PlombierNantes",
        "url": "https://example.com/membres/plombiernantes"
      },
      "commentCount": 1,
      "comment": {
        "@type": "Comment",
        "text": "35 mm cartridge replaced in twenty minutes, no more leak.",
        "datePublished": "2026-09-16T12:10:00+02:00",
        "author": {
          "@type": "Person",
          "name": "Karim_B",
          "url": "https://example.com/membres/karim-b"
        }
      }
    },
    "suggestedAnswer": [
      {
        "@type": "Answer",
        "url": "https://example.com/questions/1482/remplacer-joint-mitigeur#reponse-3312",
        "text": "If the leak is at the base of the spout rather than at the tip, it is the spout's O-rings that need replacing: pull the spout upward after removing the retaining ring.",
        "upvoteCount": 7,
        "datePublished": "2026-09-14T21:30:00+02:00",
        "author": {
          "@type": "Person",
          "name": "Sandrine44",
          "url": "https://example.com/membres/sandrine44"
        }
      }
    ]
  }
}
```

Google also accepts microdata, which is handy for not duplicating long answers in the page.

### Discourse

Verified on Discourse 2026.11. The Solved plugin, shipped with Discourse, outputs `QAPage` markup in microdata in the view served to crawlers: the reply marked as the solution becomes `acceptedAnswer`, the others `suggestedAnswer`, with `answerCount`, `upvoteCount` (number of likes) and `url`. Enable accepted answers on the help categories, then set `solved add schema markup` in `Admin > Settings`: `always` (default), `answered only` (only when a solution has been marked) or `never`. Topics in the other categories stay in `DiscussionForumPosting`.

### XenForo

XenForo 2.2 and 2.3 offer a “Question” thread type with votes and a best answer, and `QAPage` markup on those threads. The official manual gives no details: check a solved thread and a thread with no answer in the Rich Results Test after every update.

### Flarum

Verified on Flarum 2.0: with `fof/seo` (version 4, still in beta in November 2026) and `fof/best-answer`, discussions under question-and-answer tags are marked up as `QAPage`, the others as `DiscussionForumPosting`.

```bash
composer require fof/seo fof/best-answer
php flarum cache:clear
```

### phpBB

Verified on phpBB 3.3.19: no native markup, and no concept of an accepted answer in the core. Without a “best answer” extension, stay with `DiscussionForumPosting`.

### WordPress

Versions: WordPress 6.4 to 7.1; bbPress 2.6; Rank Math PRO, November 2026.

bbPress outputs no markup and has no accepted answer. Two options:

- **With Rank Math PRO**: enable the `bbPress` and `Schema (Structured Data)` modules in `Rank Math > Dashboard`. The plugin adds `QAPage`, `Question` and `Answer` to topics. Its documentation does not say how the accepted answer is chosen: check a topic in the Rich Results Test.
- **Without an SEO plugin**: on a support forum where every topic is a question, mark up the replies as `suggestedAnswer`.

```php
<?php
add_action('wp_head', function (): void {
    if (! function_exists('bbp_is_single_topic')) {
        return;
    }

    if (! bbp_is_single_topic()) {
        return;
    }

    $topicId = bbp_get_topic_id();

    $person = fn (int $userId, string $name): array => [
        '@type' => 'Person',
        'name' => $name,
        'url' => bbp_get_user_profile_url($userId),
    ];

    $replies = get_posts([
        'post_type' => bbp_get_reply_post_type(),
        'post_parent' => $topicId,
        'post_status' => bbp_get_public_status_id(),
        'orderby' => 'date',
        'order' => 'ASC',
        'posts_per_page' => bbp_get_replies_per_page(),
        'paged' => bbp_get_paged(),
    ]);

    $question = [
        '@type' => 'Question',
        'name' => bbp_get_topic_title($topicId),
        'text' => wp_strip_all_tags(get_post_field('post_content', $topicId)),
        'answerCount' => bbp_get_topic_reply_count($topicId, true),
        'datePublished' => get_post_time('c', false, $topicId),
        'author' => $person(bbp_get_topic_author_id($topicId), bbp_get_topic_author_display_name($topicId)),
    ];

    if ($replies) {
        $question['suggestedAnswer'] = array_map(fn (WP_Post $reply): array => [
            '@type' => 'Answer',
            'url' => bbp_get_reply_url($reply->ID),
            'text' => wp_strip_all_tags($reply->post_content),
            'datePublished' => get_post_time('c', false, $reply),
            'author' => $person(bbp_get_reply_author_id($reply->ID), bbp_get_reply_author_display_name($reply->ID)),
        ], $replies);
    }

    $schema = [
        '@context' => 'https://schema.org',
        '@type' => 'QAPage',
        'mainEntity' => $question,
    ];

    echo '<script type="application/ld+json">' . wp_json_encode($schema, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE) . '</script>';
});
```

Do not use this code alongside `DiscussionForumPosting` markup on the same topics.

### Laravel

Versions: Laravel 11 to 13.

Build the array outside the view (Blade compiles `@context` as a directive):

```php
$answerSchema = fn (Answer $answer): array => [
    '@type' => 'Answer',
    'url' => route('questions.show', $question) . "#reponse-{$answer->id}",
    'text' => strip_tags($answer->body_html),
    'upvoteCount' => $answer->upvotes_count - $answer->downvotes_count,
    'datePublished' => $answer->created_at->toIso8601String(),
    'author' => [
        '@type' => 'Person',
        'name' => $answer->author->name,
        'url' => route('members.show', $answer->author),
    ],
];

$mainEntity = [
    '@type' => 'Question',
    'name' => $question->title,
    'text' => strip_tags($question->body_html),
    'answerCount' => $question->answers_count,
    'upvoteCount' => $question->upvotes_count - $question->downvotes_count,
    'datePublished' => $question->created_at->toIso8601String(),
    'author' => [
        '@type' => 'Person',
        'name' => $question->author->name,
        'url' => route('members.show', $question->author),
    ],
];

$accepted = $answers->firstWhere('id', $question->accepted_answer_id);
$suggested = $answers->where('id', '!=', $question->accepted_answer_id);

if ($accepted) {
    $mainEntity['acceptedAnswer'] = $answerSchema($accepted);
}

if ($suggested->isNotEmpty()) {
    $mainEntity['suggestedAnswer'] = $suggested->map($answerSchema)->values()->all();
}

$schema = [
    '@context' => 'https://schema.org',
    '@type' => 'QAPage',
    'mainEntity' => $mainEntity,
];
```

In the view: `<script type="application/ld+json">{!! json_encode($schema, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_HEX_TAG) !!}</script>`.

### Symfony

Versions: Symfony 6.4, 7.4 and 8.x.

Assemble the same array in a service (`QaPageSchemaBuilder`), pass it to the template and render it like this:

```twig
<script type="application/ld+json">{{ schema|json_encode(constant('JSON_UNESCAPED_SLASHES') b-or constant('JSON_UNESCAPED_UNICODE') b-or constant('JSON_HEX_TAG'))|raw }}</script>
```

### Next.js

Versions: Next.js 15 and 16 (App Router).

In `app/questions/[id]/[slug]/page.tsx`, a server component:

```tsx
const toAnswer = (answer: Answer, pageUrl: string) => ({
  '@type': 'Answer',
  url: `${pageUrl}#reponse-${answer.id}`,
  text: answer.text,
  upvoteCount: answer.score,
  datePublished: answer.createdAt,
  author: { '@type': 'Person', name: answer.author.name, url: answer.author.profileUrl },
});

export function QaPageJsonLd({ question, pageUrl }: { question: Question; pageUrl: string }) {
  const accepted = question.answers.filter((answer) => answer.isAccepted);
  const suggested = question.answers.filter((answer) => !answer.isAccepted);

  const jsonLd = {
    '@context': 'https://schema.org',
    '@type': 'QAPage',
    mainEntity: {
      '@type': 'Question',
      name: question.title,
      text: question.text,
      answerCount: question.answerCount,
      upvoteCount: question.score,
      datePublished: question.createdAt,
      author: { '@type': 'Person', name: question.author.name, url: question.author.profileUrl },
      ...(accepted.length > 0 && { acceptedAnswer: accepted.map((answer) => toAnswer(answer, pageUrl)) }),
      ...(suggested.length > 0 && { suggestedAnswer: suggested.map((answer) => toAnswer(answer, pageUrl)) }),
    },
  };

  return (
    <script
      type="application/ld+json"
      dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd).replace(/</g, '\\u003c') }}
    />
  );
}
```

### Nuxt

Versions: Nuxt 3 and 4.

In `pages/questions/[id]/[slug].vue`, build the same object and declare it with `useHead({ script: [{ type: 'application/ld+json', innerHTML: JSON.stringify(jsonLd).replace(/</g, '\\u003c') }] })`, in the page's `<script setup>` so that it is rendered on the server.

## Common mistakes

- **`QAPage` on an FAQ written by the publisher** or on a page that lists several questions.
- **`acceptedAnswer` assigned to the first or last answer** with no real acceptance mechanism.
- **`answerCount` limited to the answers on the current page** of a paginated thread, or one that also counts comments.
- **Every post in the thread marked up as an `Answer`**, including thank-you messages and follow-ups: those are `comment` items.
- **Truncated text** in `text`, or an answer hidden behind a login.
- **The same `url` for every answer**: give each one an anchor.
- **Markup on listing, category or profile pages**.
- **Unanswered questions indexed in bulk** with pointless markup.
- **Spam answers marked up and indexed**: deal with [user-generated spam](https://checklist-seo-geo.com/en/user-content-forums/prevent-user-generated-spam) first.

## Frequently asked questions

### What is the difference between QAPage and FAQPage?

QAPage is for pages where a question asked by one user receives answers from other users, such as a thread on a help forum. FAQPage is for lists of questions and answers written by the site's publisher, which visitors cannot answer. Google rejects QAPage on an FAQ, and has not displayed a rich result for FAQPage since May 2026.

### Can QAPage be used on a question with no answer?

Yes, the markup remains valid with answerCount set to 0, but the page is not eligible for the rich result: Google requires at least one accepted or suggested answer. The useful question lies elsewhere: an unanswered question offers little to visitors arriving from search, and many sites choose not to index it until someone has answered.

### Is an accepted answer needed to get the rich result?

No. Google asks for at least one answer, accepted or suggested. A site with no acceptance mechanism can mark up all its answers as suggestedAnswer, with their vote count if there is one. However, never mark an answer as accepted solely on the basis of its position or date: acceptance must come from the person who asked, a moderator or the votes.

### Can QAPage and DiscussionForumPosting be combined on the same page?

No, it is not necessary and Google asks you to choose. Question-and-answer content is a special case of a forum: a page centered on one question with answers to choose between takes QAPage, an open discussion thread takes DiscussionForumPosting. On the same site, the two types coexist perfectly well, page by page, depending on the nature of each thread.

## Resources

- [Q&A structured data (Google Search Central)](https://developers.google.com/search/docs/appearance/structured-data/qapage)
- [Discussion forum structured data (Google Search Central)](https://developers.google.com/search/docs/appearance/structured-data/discussion-forum)
- [QAPage (schema.org)](https://schema.org/QAPage)
- [Question (schema.org)](https://schema.org/Question)
- [Answer (schema.org)](https://schema.org/Answer)
- [fof/seo extension for Flarum (Packagist)](https://packagist.org/packages/fof/seo)
- [QAPage markup and bbPress module (Rank Math knowledge base)](https://rankmath.com/kb/qapage-schema/)

Next steps: [mark up discussions with DiscussionForumPosting](https://checklist-seo-geo.com/en/user-content-forums/mark-up-discussions-discussionforumposting), [control the indexing of empty or thin threads](https://checklist-seo-geo.com/en/user-content-forums/control-indexing-empty-thin-threads) and [implement Person and ProfilePage](https://checklist-seo-geo.com/en/schemaorg-structured-data/implement-person-profilepage).
