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?
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.
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).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With