Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
497 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 Answer

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>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...