Liquid, JavaScript, themes, sales channels
Hi All
It seems the Shopify Product Review app is still outputting problematic JSON-LD data - in my screenshot below 'Product' data is being controlled by me in liquid and contains my product ratings. When I add the Shopify Product Review code into the mix then 'AggregateRating' gets added which causes Google to longer show my product ratings in rich snippets. When I remove the SPR code then 'AggregateRating' disappears and Google correctly shows my product ratings in rich snippets.
When I was still using the Supply theme a few weeks ago I solved this by adding the following script theme.liquid which removed the JSON data outputted by Shopify Product Reviews:
<script>
var SPRCallbacks = {
onProductLoad: function( e ) {
$('#shopify-product-reviews [type="application/ld+json"]').remove();
},
onReviewsLoad: function( e ) {
$('#shopify-product-reviews [type="application/ld+json"]').remove();
}
}
</script>
I've since moved to the paid Warehouse theme and no matter what I do this workaround doesn't work for me anymore and I'm stuck with the Shopify Product Review JSON messing up my metadata causing my ratings to no longer appear in my Google rich snippets.
This actually a big problem which Shopify is ignoring, does anyone have any ideas?
Hi ,
I used this code on this store and it works !
I think the problem is caused by your theme not the code itself , please put the store link to inspect it ....
Best Regards
Hi
Were do you apply this code? I want to remove the SPR JSON-LD from my website as well.
Hi there,
I've also applied this code to the store you provided, and it's working perfectly!
Also you can try this one : https://thegreatstock.com/collections/man
Warm Regards,
User | RANK |
---|---|
37 | |
29 | |
13 | |
12 | |
9 |
On our Shopify Expert Marketplace, you can find many trusted third party developers and fr...
By Arno Nov 27, 2023You've downloaded the Search & Discovery app from the Shopify App store, and as you're ...
By Skye Nov 8, 2023The year-end shopping season is just around the corner. Is a flash sale on your radar? Are...
By Jasonh Nov 6, 2023