JSON-LD for forum: DiscussionForumPosting and BreadcrumbList instead of FAQPage
Why not FAQPage
A popular tip is to post DiscussionForumPosting + FAQPage + BreadcrumbList on a forum thread to get expanded questions in the search results. It's outdated. As of August 2023, Google is only showing rich FAQ results for known authoritative government and health websites. For a forum, the FAQPage markup will not produce a snippet, and if the questions in it are written separately from the page, this is a violation of the rules of structured data.
FAQPage essentially describes a page where the site owner himself asks questions and answers them himself. A forum thread is different: a user posts a message, others respond. For this, Google has a separate type with support in Search - DiscussionForumPosting. If the thread is structured as a single question with a choice of the best answer, QAPage is suitable.
The main rule for any type: markup describes what the user sees on the page. The author, dates, text and responses in JSON-LD must match what is visible.
Minimum for DiscussionForumPosting
According to Google documentation, author, datePublished and at least one of text, image or video are required. Recommended are headline, url, dateModified, comment, interactionStatistic.
{
"@context": "https://schema.org",
"@type": "DiscussionForumPosting",
"headline": "Docker обходит UFW: как закрыть порт базы",
"url": "https://example.com/ru/forum/docker-ufw",
"datePublished": "2026-11-17T09:03:00+00:00",
"dateModified": "2026-11-17T12:40:00+00:00",
"author": {
"@type": "Person",
"name": "anna_dev",
"url": "https://example.com/ru/u/anna_dev"
},
"text": "На сервере включён UFW, но порт 5432 доступен снаружи...",
"interactionStatistic": [
{ "@type": "InteractionCounter", "interactionType": "https://schema.org/LikeAction", "userInteractionCount": 12 },
{ "@type": "InteractionCounter", "interactionType": "https://schema.org/WriteAction", "userInteractionCount": 3 }
],
"comment": [
{
"@type": "Comment",
"author": { "@type": "Person", "name": "ops_kz", "url": "https://example.com/ru/u/ops_kz" },
"datePublished": "2026-11-17T10:15:00+00:00",
"text": "Проверьте цепочку DOCKER-USER, правила UFW туда не попадают."
}
]
}Dates are in ISO 8601 with time zone. text - the same text that is visible on the page; You can cut it off, you can’t invent it. In comment put only the answers that are displayed on this page: if the answers are divided into pages, put your own on the second page.
BreadcrumbList
{
"@context": "https://schema.org",
"@type": "BreadcrumbList",
"itemListElement": [
{ "@type": "ListItem", "position": 1, "name": "Форум", "item": "https://example.com/ru/forum" },
{ "@type": "ListItem", "position": 2, "name": "Безопасность", "item": "https://example.com/ru/forum?category=security" },
{ "@type": "ListItem", "position": 3, "name": "Docker обходит UFW" }
]
}The last element is the current page; item does not have to be specified. The crumbs in the markup should match the visible navigation. If the page doesn't have breadcrumbs, start with those instead of JSON-LD.
Output to Next.js App Router
// app/[locale]/forum/[slug]/JsonLd.tsx
type Thread = {
title: string; url: string; body: string; createdAt: string; updatedAt?: string;
author: { name: string; url: string };
replies: { author: { name: string; url: string }; createdAt: string; body: string }[];
likes: number;
};
export function ThreadJsonLd({ t, crumbs }: { t: Thread; crumbs: { name: string; url?: string }[] }) {
const graph = [
{
"@type": "DiscussionForumPosting",
headline: t.title,
url: t.url,
datePublished: t.createdAt,
...(t.updatedAt && { dateModified: t.updatedAt }),
author: { "@type": "Person", ...t.author },
text: t.body.slice(0, 5000),
interactionStatistic: [
{ "@type": "InteractionCounter", interactionType: "https://schema.org/LikeAction", userInteractionCount: t.likes },
{ "@type": "InteractionCounter", interactionType: "https://schema.org/WriteAction", userInteractionCount: t.replies.length },
],
comment: t.replies.map((r) => ({
"@type": "Comment",
author: { "@type": "Person", ...r.author },
datePublished: r.createdAt,
text: r.body,
})),
},
{
"@type": "BreadcrumbList",
itemListElement: crumbs.map((c, i) => ({
"@type": "ListItem", position: i + 1, name: c.name, ...(c.url && { item: c.url }),
})),
},
];
const json = JSON.stringify({ "@context": "https://schema.org", "@graph": graph });
return (
<script
type="application/ld+json"
dangerouslySetInnerHTML={{ __html: json.replace(/</g, "\\u003c") }}
/>
);
}Replacing < with < is mandatory: in the text of messages, users write whatever they want, and the line </script><script>... will otherwise close the tag and be executed as code. The search engine's JSON parser will read the escaped form correctly.
For typing, you can connect the schema-dts package - it catches typos in property names at the compilation stage.
Editorials are not forum posts
Google explicitly states that DiscussionForumPosting is intended for user-generated content. If the thread was written by the site editors as a guide article, it is more correct to Article (or TechArticle) with the same author and dates. On a mixed forum, the type is chosen based on the origin of the text: a participant’s publication is a forum post, editorial material is an article.
How to check
- Rich Results Test shows whether the type is recognized and which required fields are missing. Check the URL, not the inserted fragment: this way you can see what the server is actually returning.
- Schema Markup Validator (validator.schema.org) checks against the schema.org vocabulary as a whole, including types that Google does not support in snippets.
- A report on forum markup will appear in Search Console when Google finds it on the pages. There you can see errors throughout the site, not just on one page.
Frequent errors
- Two JSON-LD blocks for one entity: one from layout, the other from the page. The search engine sees two different publications.
author.namein the markup is the real name from the profile, and the nickname is displayed on the page. This is a discrepancy.datePublishedis taken from the build time or last change, not the publication time.- The
interactionStatisticcounters are cached in the daily layout and differ from the visible ones.
When markup won't help
Structured data doesn't make up for thin content. A one-line thread with no replies will not be any more noticeable by correct JSON-LD. First useful discussions and normal indexing, then markup that describes them.