9

I have the following code for rich snippet on comments:

<ul itemscope itemtype="http://schema.org/UserComments">
    <li id="comment-1" class="comment">
        <span itemprop="name" class="author">Author 1</span>
        <p itemprop="commentText">Bla Bla Bla</p>
        <time itemprop="commentTime" content="2012-07-29" datetime="2012-07-29T05:55+00:00" title="Jul 29, 2012 5:55">2 days ago</time>
    </li>

    <li id="comment-2" class="comment">
        <span itemprop="name" class="author">Author 2</span>
        <p itemprop="commentText">yada yada yada</p>
        <time itemprop="commentTime" content="2012-07-30" datetime="2012-07-30T04:44+00:00" title="Jul 30, 2012 4:44">yesterday</time>
    </li>
 </ul>

According to schema.org/UserComments, this is correct. However, Google's Rich Snippets Testing Tool is giving an warning:

Warning: Missing required field "dtstart".

dtstart is not even a property of UserComments event. Should I ignore this warning (Google's tool is beta)? Or am I missing something?

BoltClock
  • 700,868
  • 160
  • 1,392
  • 1,356
rlcabral
  • 1,496
  • 15
  • 39

4 Answers4

11

I think I found the answer. The correct HTML code seems to be like this:

<ul>
    <li id="comment-1" itemtype="http://schema.org/Comment" itemscope="itemscope" itemprop="comment">
        <span itemprop="author">Author 1</span>
        <p itemprop="text">Bla Bla Bla</p>
        <time itemprop="dateCreated" content="2012-07-29" datetime="2012-07-29T05:55+00:00" title="Jul 29, 2012 5:55">2 days ago</time>
    </li>
 </ul>

Each comment has its own itemscope. It means you have to repeat itemtype="http://schema.org/Comment" itemscope="itemscope" itemprop="comment" on each comment.

I came to this conclusion after checking Google's example for "Products with many offers". They use as example a eBay page that contains multiple reviews about the product. Review and Comment are both part of CreativeWork.

rlcabral
  • 1,496
  • 15
  • 39
1

I was able to get the Google validator to correctly validate a page using UserComments. I admit it's hard to decide which is the preferred comment format to use (UserComments vs Comment), but http://schema.org/CreativeWork declares comment to be of type UserComments, so I'm going with that for now.

Assuming your instance of UserComments is inside something like a CreativeWork, I believe the key to avoiding this validation error from Google is adding the itemprop='comment' property to UserComment itemscope element.

In your case, try to update your line to include that attribute, i.e.:

<ul itemprop="comment" itemscope itemtype="http://schema.org/UserComments">

I found that when UserComments contained in a CreativeWork contain the correct itemprop, Google parsed them correctly with no error. I did see this error when itemprop='comment' was missing, I believe Google is treating it as a generic event in that case. Incidentally, startDate is a synonym for dtstart (ref: https://support.google.com/webmasters/answer/164506?hl=en).

William Denniss
  • 16,089
  • 7
  • 81
  • 124
0

Use it without: itemprop="comment"

<ul>
    <li id="comment-1" itemtype="http://schema.org/Comment" itemscope="itemscope">
        <span itemprop="author">Author 1</span>
        <p itemprop="text">Bla Bla Bla</p>
        <time itemprop="dateCreated" content="2012-07-29" datetime="2012-07-29T05:55+00:00" title="Jul 29, 2012 5:55">2 days ago</time>
    </li>
 </ul>
0

After a lot of tries and errors I have found something that works and passes tests I did with a testing tool.

<div itemprop="comment" itemscope itemtype="http://schema.org/UserComments">
    <p itemprop="commentText"> bla bla bla </p>
    <span itemprop="name" class="author">billy bob</span>
    <span itemprop="commentTime" content="2014.2.28" >Feb 28 2014</span>
</div>
Mickäel A.
  • 9,012
  • 5
  • 54
  • 71
Don
  • 1
  • This (at least currently) also produces the error in Google’s tool: Missing required field "dtstart". – unor Apr 03 '14 at 15:10