How should nested forum replies be ordered in structured data?

The Citead team, updated

In short. Order each forum comment array like the visible replies and nest every reply under the post or comment it answers.

Definition: In DiscussionForumPosting structured data, nested replies use Comment objects under the post or comment they answer. Within each comment collection, list those objects in the same order in which the corresponding replies appear on the page.

Key facts

  • Google's Discussion Forum documentation recommends nesting a comment under the post it relates to.
  • A forum with threading should represent that structure as a tree of comments, according to the same documentation.
  • Google says to mark up comments in the order in which they appear on the page, both for replies to a post and for replies to a comment.
  • For a linear series of replies, Google says to nest all replies under the original post as comments.
  • Google describes commentCount as useful when some comments are absent from the current comment markup.

How does the comment tree represent reply order?

The comment property has two jobs here: it identifies a response and it carries the response's position among the visible replies at that level. If a forum has its own threading structure, Google's example uses a Comment inside the post's comment array, then places the reply to that comment inside the parent's nested comment array.

{
  "@context": "https://schema.org",
  "@type": "DiscussionForumPosting",
  "headline": "Very Popular Thread",
  "comment": [{
    "@type": "Comment",
    "text": "This should not be this popular",
    "comment": [{
      "@type": "Comment",
      "text": "Yes it should"
    }]
  }]
}

The array at each level therefore represents the visible order of that parent’s direct replies. A child reply belongs inside its parent’s comment property; it is not a second top-level reply merely because it appears lower on the screen. The documented rule is about the order in which replies appear on the page, so datePublished supplies the comment time and does not replace that ordering rule.

What changes for a linear forum?

Some forums display an original post followed by a single series of replies rather than a reply tree. Google's documentation says to nest that series under the original post as comments. Its example uses First Post on this Page followed by Second Post on this Page, so the comment array follows the page’s displayed sequence.

For a multi-page thread, the same documentation recommends that later pages include the original post with the main page URL. If a page contains only part of a discussion, commentCount can report the number of comments about the post when not all of them are included in the markup. The count describes coverage; it does not supply the missing reply objects or their positions.

How can you check the correspondence?

Compare the rendered thread with the JSON-LD at each parent. Check that every marked-up reply is present on the page, that its text or media represents the visible reply, and that sibling objects use the same sequence as the visible replies. Google's general structured data guidelines require structured data to be a true representation of page content and say that structured data should fully represent content visible to users.

Then validate the markup with the Rich Results Test. A passing syntax check does not remove the need to review the parent-child relationships and the displayed order, because the order rule depends on the page’s content and layout.

FAQ

Should I flatten every reply into the top-level comment array?

No. When the forum exposes threading, keep each reply under the Comment or post it answers, and preserve the visible order among that parent’s direct replies. A linear forum is the documented case where replies all sit under the original post.

Should I sort the array by datePublished?

Use the order shown on the page. Google separately defines datePublished as the date and time the comment was made in ISO 8601 format, while its ordering instruction refers to the comment’s position on the page.

What if the page shows only some replies?

Mark up the comments represented on that page and use commentCount when the total number of comments is useful and some are absent from the markup. The documented property is particularly useful when not all comments are present.

Sources

  1. Google Search Central, "Discussion Forum (DiscussionForumPosting, SocialMediaPosting) Schema Markup", 8 September 2026
  2. Google Search Central, "General Structured Data Guidelines", 10 July 2026
  3. Schema.org, "Comment", undated

Check how a page reads to answer engines. Open the GEO score analyzer

Test a page and see what to fix first

The analysis usually takes less than 10 seconds and needs no account.

400,000+ pages scored in the public benchmark