How to Add DiscussionForumPosting Schema to Your Forum

Structured data provides search engines with a standardized way to read and interpret the discussions happening across your community. When you implement forum markup, Google Search can better identify your community threads and use that data in features like Discussions and Forums. If you are already working on your forum SEO basics, adding structured data is a direct way to clarify the roles of original posters, replies, and threaded conversations. This setup guide walks through the complete process of preparing, structuring, testing, and releasing your markup according to the official documentation.
Step 1: Verify Content Eligibility and Choose Your Schema Type
Before writing code, ensure your discussions match the rules outlined in Google's DiscussionForumPosting documentation. Discussion forum markup is intended specifically for user-generated posts where people share first-hand perspectives. You should not use this markup on content written directly by website publishers or their agents, nor should you use it for product reviews or standalone articles.
Review these specific distinctions when evaluating your platform:
- DiscussionForumPosting: Use this for general forum threads and user-generated community topics.
- SocialMediaPosting: If your platform functions more like a general social media network where members post media and updates, you can use this parent type, which shares the same requirements.
- Q&A markup: If your forum operates primarily around questions and accepted or voted answers, Google recommends using Q&A structured data instead of general discussion posting markup.
Step 2: Select Your Format (Microdata vs. JSON-LD)
Google supports both JSON-LD and Microdata (or RDFa) formats. In standard search documentation, JSON-LD is often highlighted; however, for discussion forums, Google specifically recommends Microdata or RDFa if possible. Using inline Microdata tags around your existing HTML elements prevents you from needing to duplicate large bodies of user text inside a separate script tag. Even so, this remains a recommendation, and JSON-LD is fully supported if your forum software generates structured data via script blocks.
Step 3: Map Threading and Page Hierarchy
How you arrange your markup depends on the layout of your forum software:
- Linear forums: If your software displays an original post followed sequentially by responses, nest all replies as
Commenttypes under the main original posting. When threads span multiple pages, later pages should ideally include the original post along with the main page URL. - Threaded forums: If your platform allows nested replies to replies, create a comment tree where each
Commentcan itself contain nestedcommentproperties matching the visual thread. - Primary thread pages: If a URL is dedicated to a single post, use
mainEntityormainEntityOfPageto identify that specific posting. - Topic and category lists: On pages listing multiple posts, do not label an individual post as the main entity unless the URL is a dedicated discussion page for that post. You may attach grouped posts to an
ItemListorCollection.
Step 4: Include Required and Recommended Properties
To ensure eligibility, your markup must supply all required fields for the original post, as well as the full text of each contribution. Google requires:
author: APersonorOrganizationobject containingauthor.name.datePublished: The post creation date and time supplied in ISO 8601 format.text,image, orvideo: At least one of these content properties must be present to represent the post (unless referencing an external URL on category or later thread pages).
Beyond the required fields, several recommended properties improve data clarity. You can supply author.url linking to a member's profile page, commentCount to state the total number of replies, and dateModified in ISO 8601 format if an edit took place. If an edited or removed entry is kept in the thread solely for context, you can set the creativeWorkStatus property to Deleted. Additionally, if automated tools or language models produce text on your boards, you can mark the digitalSourceType as TrainedAlgorithmicMediaDigitalSource or AlgorithmicMediaDigitalSource.
Step 5: Validate Your Code Before Deployment
Before pushing updates live across thousands of threads, validate a sample markup template using Google's Rich Results Test. This tool evaluates whether your code meets technical requirements and highlights syntax issues. Resolve any critical errors immediately. While fixing non-critical warnings is not mandatory to qualify for search presentation, addressing them improves your structured data quality.
Step 6: Inspect Live URLs and Submit Your Sitemap
Once you verify the template, publish the changes to a small selection of pages. Open Google Search Console and run the URL Inspection tool to verify how Google renders the live pages. Confirm that Google can access the page without being blocked by your robots.txt file, login requirements, or a noindex directive. If the page inspects cleanly, you can request indexing through the tool to ask Google to recrawl your URLs.
Finally, keep search engines updated on newly created threads and ongoing replies by maintaining an XML sitemap. You can submit your sitemap manually in Search Console or automate updates directly using the Search Console Sitemap API.
Sources
Discussion Forum (DiscussionForumPosting, SocialMediaPosting) Schema Markup | Google Search Central
Published October 28, 2026. No affiliate links on this page. Facts come from the sources linked above; check them for updates.