XooCode(){

CommentAction

CommentAction is a CommunicateAction subtype for posting a comment. Property: resultComment (Comment). Use ReplyAction when the target is another comment.

Full example of schema.org/CommentAction json-ld markup

The markup is verified as valid with Rich Results Test from Google.

schema.org/CommentAction
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "CommentAction",
  "agent": { "@type": "Person", "name": "Reader" },
  "resultComment": { "@type": "Comment", "text": "Great article — saved." }
}
</script>

Minimal valid version

The smallest markup that still produces a valid CommentAction entity. Use it as the floor. Reach for the advanced example above when you want search engines and AI agents to understand more about your content.

schema.org/CommentAction (minimal)
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "CommentAction",
  "resultComment": { "@type": "Comment", "text": "Comment text" }
}
</script>

Google rich results this unlocks

CommentAction is a structural type. It does not produce a rich result on its own.

Its value comes from combining it with a primary type whose markup earns a rich result (Article, Product, Event, and so on). CommentAction becomes the trunk that the primary type branches off viamainEntityorbreadcrumb. Include it on every page as the backbone of your markup.

Common CommentAction mistakes

Mistakes that pass validation but silently fail to earn rich results or mislead consumers walking the graph. Avoid these and your markup will be ahead of most sites in the wild.

  1. 01

    CommentAction on a reply

    Wrong
    CommentAction targeting another comment
    Right
    ReplyAction for replies; CommentAction for top-level comments

    Use the more specific ReplyAction when the target is a comment.

Also mentioned in 1 other example

CommentAction also appears in InteractionCounter. See the full CommentAction schema page for every reference.

About the example data

Commenting on a Xoo Code post.

Comments

Loading comments...

Leave a comment