How to add star rating for each post in Hugo?

Google search displays star rating in search. Is it possible to add star rating in Hugo? If yes then how is it done?

Please rephrase your question.

Adding Star rating ranks your post in google search as displayed in above. Just enter same query in Google see what you get.

Are you trying to mimic that functionality on your content items?

If you are talking about how to get Google star ratings placed next to your Hugo content when it appears in Google search, this is unrelated to Hugo as far as I can see and OT for this forum. However, it looks like you can get testimonial tools that let people put a ranking on your post, and which apparently make it more likely that google will show the ranking summary in search. It is possible that you could integrate such a tool in your Hugo templates, provided it can be integrated with a standard static site.

To add a review snippet (like the one from your screenshot) you’ll need to add the required proper markup to your Hugo site.

If you meant to ask, ‘how do I let people rate content on my Hugo website?’, then this isn’t possible with a 3rd party service since Hugo is a static site generator. So there’s no Hugo tool to track user reviews and accounts.

I would like to make it a feature request for future Hugo Releases. I wanted to show that star rating can put you on top of search result and bring you massive amount of traffic for website of any kind. If Hugo cannot create feature like this then someone else may create feature like this for Hugo websites. I just wanted to put this out there.

Hugo is a static site generator using templates to produce output. A lot of folks aren’t used to that, and consider adding components that require dynamic interactions beyond HTML, CSS and JS.

Hugo is not a company, and anyone can make templates for Hugo.

I’m explaining it this way so you understand this is a moot point. If one wants to add review snippet code to Hugo, one does that. Features are for changing how Hugo operates as software.

That’s good news for you, it isn’t a feature, just the effort to add a template with the code you need. :slight_smile:

You will need to add custom metadata to your templates that Google recognizes and parses as reviews.

Microformats is one of the popular formats. Here’s its wiki on how to add Google search compatible meta.

A write-up on why Microformats for Google reviews.