Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
465 views
in Technique[技术] by (71.8m points)

html - Display an article rating in Google search results

Im writing a review site where the community rates posts. I have noticed that Google can pick up on this ratings and display them in its search results. Does anyone know how this is achieved?

An example is a review site like IGN, where in their screen shot below they have indicated their review has a rating of 9.3/10.

enter image description here

How can I indicate to Google my own review rating? Maybe some sort of custom meta tag or something.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You can do that with a Span class. Check Google's Structure Data guide for Review:

A review is someone's evaluation of something. We support reviews and ratings for a wide range of schema.org types, including businesses, products, and different creative works such as books or movies.

Google displays the following types of reviews in search results:

  • Critic review: A snippet from a longer review article that a single editor has created, curated, or compiled for a publisher.

  • Review snippets: A rich result (previously known as a rich snippet) of a review or rating markup from a review website, usually an average of the combined rating scores from reviewers. Review snippets appear in Google Search results either under the search result or in the Google Knowledge Cards.

[...]

Here's an example of an aggregate rating.

<div itemscope itemtype="http://schema.org/Book">
  <h2 itemprop="name"> Super Book </h2>
  <div itemprop="description">Ultra interesting. Super impressive.</div>
  <div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
    <div>Book rating:
      <span itemprop="ratingValue">88</span> out of 
      <span itemprop="bestRating">100</span> with
      <span itemprop="ratingCount">20</span> ratings
    </div>
  </div>
</div>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...