Check 49.01 · User content and forums

Mark up discussions with DiscussionForumPosting

Mark up discussion threads with DiscussionForumPosting: the properties Google expects, nested replies, pagination and setup for each forum software.

Priority
Important
Difficulty
Intermediate
Estimated time
2 hours to 1 day
Free, no account: your progress is saved in this browser.

Ask an AI to check this point on your site

Opens the assistant with a ready-made question: this check, its goal and your site URL.

For Gemini, Copilot or another assistant, copy the question. The link opens the chosen service directly: nothing goes through this site.

In short

DiscussionForumPosting is the schema.org type that describes a post published by a user on a forum, with its replies as Comment items. Google uses it to identify discussions and surface them in features such as “Discussions and forums”. Once this check is done, every thread page exposes the original post, its author, its dates and the replies shown, with no errors in the Rich Results Test.

Why it matters

A forum page mixes an original post, replies, quotes, signatures and interface elements. Without markup, the search engine has to guess who wrote what, when, and which reply answers which. Markup gives it that information: author and profile page, publication and modification dates, reply structure, interaction counts.

Google documents three cases that should not be confused:

Situation Type to use
General forum, discussion thread, help topic with no “accepted” answer DiscussionForumPosting
Page centered on one question and its user-submitted answers QAPage: see mark up question-and-answer pages (opens in a new tab)
General social media platform (posts, reshares) SocialMediaPosting, the parent type, same requirements
Article or video by the publisher, even with comments Article, VideoObject: no DiscussionForumPosting

The two types are not combined on the same page: choose the one that matches the thread. Product reviews are not covered by this markup either.

For generative engines, nothing is documented: neither OpenAI, Anthropic nor Perplexity says it reads this markup. What counts for them is the text visible in the HTML, hence the value of making contributions readable without JavaScript or login (opens in a new tab). Discussions do, however, carry weight in their answers: that is also why it is worth contributing to Reddit and specialized forums (opens in a new tab).

What it improves

  • Google's understanding of threads Author, dates and reply hierarchy made explicit. Google does not guarantee any display.
  • Eligibility for “Discussions and forums” The documentation mentions this feature without specifying the countries or languages concerned.
  • Attribution author.url ties each post to a profile, provided you control the indexing of member profiles (opens in a new tab).
  • Monitoring Search Console reports valid and invalid items, which also reveals broken templates.
  • Rankings No documented direct effect.
  • AI citations Unproven; the effect comes from the visible text, not from the markup.

How to check

Look for the markup in the served HTML, in JSON-LD or microdata:

curl -s https://example.com/forum/entretien/purger-radiateur-fonte | grep -o -E '(DiscussionForumPosting|QAPage|"@type": ?"Comment"|schema.org/Comment)' | sort | uniq -c

Then paste the URL into the Rich Results Test: an item of the discussion forum type should be detected, with no critical errors. Check by hand four points the tool cannot see:

  1. The marked-up text is the full text of the post, not an excerpt.
  2. Every reply shown on the page is marked up, in display order.
  3. On page 2 of a thread, url points to the first page.
  4. author.url leads to a profile page that returns a 200.

Across the whole site, follow the enhancement report in Search Console: see monitor structured data errors (opens in a new tab).

How to implement

Before you start

Properties Google reads on the original post:

Property Status Note
author with author.name Required Person or Organization
datePublished Required ISO 8601, with time zone
text, image or video Required (one of the three) Full text; only images and videos embedded in the post
headline Recommended Thread title, without copying or truncating the body of the post
url Recommended Canonical URL of the discussion; first page for a paginated thread
author.url Recommended Profile page, ideally marked up as a ProfilePage (opens in a new tab)
comment, commentCount Recommended Replies in display order; commentCount when not everything is marked up
dateModified Recommended Only if the post has been edited
interactionStatistic Recommended LikeAction, DislikeAction, ViewAction, ReplyAction or CommentAction, ShareAction
isPartOf Recommended Subforum or category
creativeWorkStatus Recommended Deleted for a post that was removed but kept for context
digitalSourceType Recommended To be set for a reply produced by a bot or a language model
sharedContent Recommended Link, image, video or quoted post that is the main subject of the post

Each Comment needs author, datePublished and content (text, image or video). Give it its own url if it has an anchor or a permalink.

Structure rules:

  • Linear forum: all replies are comment items of the original post. Forum with nested replies: a reply to a reply is a comment of that reply.
  • Paginated thread: each subsequent page repeats the original post with url pointing to the first page, followed by that page's replies. See handle the pagination of long threads (opens in a new tab).
  • Listing pages (category, profile): mark up only what is displayed, without designating a post as the main entity.
  • Format: here Google recommends microdata or RDFa, to avoid duplicating long texts, while fully supporting JSON-LD. On a very long thread, microdata keeps the page lighter; elsewhere, JSON-LD (opens in a new tab) remains easier to maintain.

Complete example for the first page of a thread:

{
  "@context": "https://schema.org",
  "@type": "DiscussionForumPosting",
  "mainEntityOfPage": "https://example.com/forum/entretien/purger-radiateur-fonte",
  "url": "https://example.com/forum/entretien/purger-radiateur-fonte",
  "headline": "Bleeding a cast-iron radiator with no bleed valve",
  "text": "My 1960s cast-iron radiator has no bleed valve and stays cold at the top. How do I get the air out without removing the plug?",
  "datePublished": "2026-10-02T08:14:00+02:00",
  "dateModified": "2026-10-02T09:01:00+02:00",
  "isPartOf": "https://example.com/forum/entretien",
  "author": {
    "@type": "Person",
    "name": "Lucie_R",
    "url": "https://example.com/membres/lucie-r"
  },
  "interactionStatistic": [
    {
      "@type": "InteractionCounter",
      "interactionType": "https://schema.org/LikeAction",
      "userInteractionCount": 4
    },
    {
      "@type": "InteractionCounter",
      "interactionType": "https://schema.org/ViewAction",
      "userInteractionCount": 1280
    }
  ],
  "commentCount": 3,
  "comment": [
    {
      "@type": "Comment",
      "url": "https://example.com/forum/entretien/purger-radiateur-fonte#message-2",
      "text": "Slightly loosen the blanking plug at the top with an adjustable wrench, with a cloth underneath, until water comes out, then tighten it again.",
      "datePublished": "2026-10-02T10:30:00+02:00",
      "author": {
        "@type": "Person",
        "name": "Chauffagiste38",
        "url": "https://example.com/membres/chauffagiste38"
      },
      "interactionStatistic": {
        "@type": "InteractionCounter",
        "interactionType": "https://schema.org/LikeAction",
        "userInteractionCount": 9
      },
      "comment": [
        {
          "@type": "Comment",
          "url": "https://example.com/forum/entretien/purger-radiateur-fonte#message-3",
          "text": "Done this morning, the radiator now heats all the way up. Thanks.",
          "datePublished": "2026-10-03T07:45:00+02:00",
          "author": {
            "@type": "Person",
            "name": "Lucie_R",
            "url": "https://example.com/membres/lucie-r"
          }
        }
      ]
    },
    {
      "@type": "Comment",
      "url": "https://example.com/forum/entretien/purger-radiateur-fonte#message-4",
      "text": "Post removed by the moderators.",
      "creativeWorkStatus": "Deleted",
      "datePublished": "2026-10-03T11:02:00+02:00",
      "author": {
        "@type": "Person",
        "name": "Deleted member"
      }
    }
  ]
}

On page 2, keep @type, headline, author, datePublished and url (first page), replace mainEntityOfPage with the URL of page 2 and list that page's replies in comment.

Discourse

Verified on Discourse 2026.11. Built in, with nothing to configure: the view served to crawlers (add ?print to the URL to see it) marks up the topic as DiscussionForumPosting and each reply as Comment, in microdata, with author, dates and number of likes. Topics in categories where the bundled Solved plugin is active switch to QAPage. You have nothing to add.

XenForo

XenForo 2.3 natively outputs DiscussionForumPosting markup on threads; fixes have shipped over the 2.3.x releases (the text property instead of articleBody in 2.3.7). Update, then check a thread in the Rich Results Test: the official manual does not describe this markup in detail.

phpBB

Verified on phpBB 3.3.19: the prosilver style contains no schema.org markup on viewtopic. Two options: an extension from the official database, to be tested before going to production, or adding microdata to viewtopic_body.html in a child style (itemscope itemtype="https://schema.org/DiscussionForumPosting" on the first post, itemprop="comment" on the following ones). Purge the cache from the administration panel after the change.

Flarum

Verified on Flarum 2.0: the core does not output this markup. The fof/seo extension (Friends of Flarum, version 4 for Flarum 2, still in beta in November 2026) adds DiscussionForumPosting with reply, like and view counts, and switches to QAPage with fof/best-answer.

composer require fof/seo
php flarum cache:clear

WordPress

Versions WordPress 6.4 to 7.1; bbPress 2.6.

Post comments are not covered by this type: the post keeps its Article markup. bbPress outputs no schema.org markup, and BuddyPress documents none for its activity streams. Rank Math PRO offers a bbPress module, but it produces QAPage. For a general bbPress forum, add this code in a small plugin:

<?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();
    $topicUrl = bbp_get_topic_permalink($topicId);

    $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(),
    ]);

    $schema = [
        '@context' => 'https://schema.org',
        '@type' => 'DiscussionForumPosting',
        'mainEntityOfPage' => get_pagenum_link(bbp_get_paged()),
        'url' => $topicUrl,
        'headline' => bbp_get_topic_title($topicId),
        'text' => wp_strip_all_tags(get_post_field('post_content', $topicId)),
        'datePublished' => get_post_time('c', false, $topicId),
        'isPartOf' => bbp_get_forum_permalink(bbp_get_topic_forum_id($topicId)),
        'author' => $person(bbp_get_topic_author_id($topicId), bbp_get_topic_author_display_name($topicId)),
        'commentCount' => bbp_get_topic_reply_count($topicId, true),
        'comment' => array_map(fn (WP_Post $reply): array => [
            '@type' => 'Comment',
            '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),
    ];

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

The code assumes linear replies and public profiles; remove the author's url for anonymous contributions. Clear the page cache after activation.

Laravel

Versions Laravel 11 to 13.

Build the array in the controller or in a dedicated class, never in the view: Blade compiles @context as a directive.

$schema = [
    '@context' => 'https://schema.org',
    '@type' => 'DiscussionForumPosting',
    'mainEntityOfPage' => $request->url(),
    'url' => route('threads.show', $thread),
    'headline' => $thread->title,
    'text' => strip_tags($thread->body_html),
    'datePublished' => $thread->created_at->toIso8601String(),
    'author' => [
        '@type' => 'Person',
        'name' => $thread->author->name,
        'url' => route('members.show', $thread->author),
    ],
    'commentCount' => $thread->replies_count,
    'comment' => $replies->map(fn (Reply $reply): array => [
        '@type' => 'Comment',
        'url' => route('threads.show', $thread) . "#message-{$reply->id}",
        'text' => strip_tags($reply->body_html),
        'datePublished' => $reply->created_at->toIso8601String(),
        'author' => [
            '@type' => 'Person',
            'name' => $reply->author->name,
            'url' => route('members.show', $reply->author),
        ],
    ])->all(),
];

In the view: <script type="application/ld+json">{!! json_encode($schema, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_HEX_TAG) !!}</script>. $replies is the page of replies being displayed, not the whole collection.

Symfony

Versions Symfony 6.4, 7.4 and 8.x.

Pass the same array to the template from the controller, then render it in the <head> block:

<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>

JSON_HEX_TAG prevents a post containing </script> from breaking the page.

Next.js

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

In app/forum/[slug]/page.tsx, generate the markup on the server, from the same data as the display:

export default async function ThreadPage({ params }: { params: Promise<{ slug: string }> }) {
  const { slug } = await params;
  const thread = await getThread(slug);
  const threadUrl = `https://example.com/forum/${thread.slug}`;

  const jsonLd = {
    '@context': 'https://schema.org',
    '@type': 'DiscussionForumPosting',
    mainEntityOfPage: threadUrl,
    url: threadUrl,
    headline: thread.title,
    text: thread.text,
    datePublished: thread.createdAt,
    author: { '@type': 'Person', name: thread.author.name, url: thread.author.profileUrl },
    commentCount: thread.replyCount,
    comment: thread.replies.map((reply) => ({
      '@type': 'Comment',
      url: `${threadUrl}#message-${reply.id}`,
      text: reply.text,
      datePublished: reply.createdAt,
      author: { '@type': 'Person', name: reply.author.name, url: reply.author.profileUrl },
    })),
  };

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

Nuxt

Versions Nuxt 3 and 4.

In pages/forum/[slug].vue, declare the same object with useHead, so that it is rendered on the server:

useHead({
  script: [
    {
      type: 'application/ld+json',
      innerHTML: JSON.stringify(jsonLd).replace(/</g, '\\u003c'),
    },
  ],
});

Common mistakes

  • Each reply marked up as a separate DiscussionForumPosting instead of a Comment nested under the original post.
  • url on page 2 pointing to itself: the thread ends up split into as many discussions as there are pages.
  • Truncated text or a summary in place of the full post.
  • Markup applied across the whole site: category pages, articles by the publisher, product pages with reviews.
  • DiscussionForumPosting and QAPage combined on the same page.
  • Default avatar or logo declared in image, which is reserved for images embedded in the post.
  • Markup injected with JavaScript after login: Googlebot sees neither the text nor the data.
  • author.url pointing to profiles that return a 404 or are members-only.
  • Spam threads marked up: start by preventing user-generated spam (opens in a new tab).

Frequently asked questions

What is the difference between DiscussionForumPosting and QAPage?

DiscussionForumPosting describes an open discussion thread: an original post followed by replies, with no answer singled out as the right one. QAPage describes a page centered on a single question, with user-submitted answers, one of which can be accepted. Google treats question-and-answer content as a special case of a forum and asks you to choose only one of the two types per page, depending on the nature of the thread.

Does DiscussionForumPosting markup improve rankings in Google?

No, Google documents no effect on rankings. DiscussionForumPosting markup helps Google identify a discussion, its author, its dates and its replies, and makes the page eligible for features such as “Discussions and forums”. Display is never guaranteed, and a thread that is thin or overrun with spam will gain nothing from it, marked up or not.

Should blog comments be marked up with DiscussionForumPosting?

No. Google reserves DiscussionForumPosting for content published by users on a forum-type site. An article written by the publisher keeps its Article markup, even if it receives comments. You can describe those comments with the article's comment property, but this is not a Google requirement and no rich result depends on it.

Do generative engines read forum markup?

Nothing documents it. No AI assistant provider says it uses DiscussionForumPosting to choose or cite a discussion. What is established is that these systems read the text present in the HTML: a thread whose posts are displayed without JavaScript and without login, with visible authors and dates, is usable whether the markup is present or not.

How do I mark up a deleted post in a thread?

If the post disappears from the page entirely, remove it from the markup as well. If it remains displayed as a placeholder notice, to keep the thread understandable, keep the Comment item and add the creativeWorkStatus property with the value Deleted, as Google's documentation provides. Never mark up the original text of a post that visitors can no longer see.

Updated on

Topic checklist (PDF)

And now?

In the “User content and forums” topic

  1. Mark up discussions with DiscussionForumPosting
  2. Mark up question-and-answer pages with QAPage
  3. Prevent user-generated spam
  4. Control the indexing of empty or thin threads
  5. Control the indexing of member profiles
  6. Handle the pagination of long threads
  7. Make contributions readable without JavaScript or login