Hi, I wanted to know how can I add structured data for reviews. Do I need to have a review app before adding structured data?
Hello @Gege_1
- Go to your Shopify admin panel and navigate to Online Store > Themes > Actions > Edit code.
- In the Theme.liquid file, locate the product-template.liquid section.
- Add the following code to the product-template.liquid section:
{% if product.reviews %}
<script type="application/ld+json">{
"@context": "http://schema.org",
"@type": "Review",
"itemReviewed": {
"@type": "Product",
"name": "{{ product.title }}",
"url": "{{ product.url }}"
},
"author": {
"@type": "Person",
"name": "{{ product.author }}"
},
"reviewRating": {
"@type": "Rating",
"ratingValue": "{{ product.rating }}",
"bestRating": "5"
},
"reviewBody": "{{ product.review }}"
}</script>
{% endif %}
Save the Theme.liquid file.
Once you have completed these steps, your Shopify store will have structured data for reviews. This will help search engines like Google understand your reviews and display them in search results.
No, you don’t need a review app to add structured data for reviews to your Shopify store. However, if you want to collect reviews from your customers, you can use a review app. There are many different review apps available for Shopify, so you can choose one that fits your needs. Please note, review app must be having structured data in it.
Thanks for the reply, but I wanted to know before I said download a reviews app to tell structured data where the reviews get them you know what I’m saying. Then I noticed that many sites that have structured review data based on the product show that in google search some products have 3.5 stars and others 2.0 etc etc. These reviews are from people who have reviewed a product. Another thing I wanted to know this code you got it on google search central from this link: https://developers.google.com/search/docs/appearance/structured-data/review-snippet?hl=it#json-ld
I wait for your answers