How to set Google Rich Snippet for Search?

Step.1 Add reviews on google.

Add snippet  'th-product-review-seo' and add the below code in the snippet.

{% assign product_schema = product.metafields.product_schema %}

{% if product_schema['th_ratingCount'] > 0 %}

<div itemprop="itemReviewed" itemscope itemtype="https://schema.org/Product">

<span itemprop="name">{{ product.title }}</span>

<span class="resourcesratingssummary" itemprop="aggregateRating" itemscope="" itemtype="https://schema.org/AggregateRating">

<meta itemprop="itemreviewed" content="{{ product.title }}">

<meta itemprop="ratingValue" content="{{ product_schema['th_ratingValue'] }}">

<meta itemprop="worstRating" content="1">

<meta itemprop="bestRating" content="5">

<meta itemprop="reviewCount" content="{{ product_schema['th_ratingCount'] }}">

</span>

</div>

{% endif %}


Step.2  Add file for review.

Please add the below code in  product-template.liquid.

{% include 'th-product-review-seo' %}

Step.3 Check-in structured data testing tool. You just need to paste here any product URL and click on RUN TEST. You will see the Aggregate ratings there. PREVIEW button to see how it will display on Google.

When you click on the  PREVIEW button you will see how it will display after Google will crawl your products.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us