Archived topic
adding aggregateRating for my website
10 replies · Started by Sima on August 11, 2022
I have created the following hook but when I test my website for google rich results, I do not see this property.
{
"@context": "https://schema.org/",
"@type": "CreativeWorkSeries",
"name": "",
"aggregateRating": {
"@type": "AggregateRating",
"ratingValue": "4.9",
"bestRating": "5",
"ratingCount": "17"
}
}
Hi there,
can you share a link to the page where this should be displayed?
And can you confirm how you used a Hook to add this ?
Hello David,
I added to WP_head and elected entire site for display rule.
When I check my website URL at https://search.google.com/test/rich-results
I expect to see Review Snippets but I do not.
It looks like it's been inserted into thebody_open hook.
If you've made changes to the hook, make sure cache is cleared.
I have cleared cache. and I have not inserted it into body_open hook. Pleae let me know what I should do. thanks
From what I can see, it's in body not head:
https://www.screencast.com/t/w1NNCaPtBPMk
Can you disable your cache plugin if you are using one and if you have server-level cache enabled, can you disable that as well?
If it still doesn't work, could you provide admin login to your site so we can take a look at the backend?
It still does not work.
That code has to be wrapped in script tags
‹script type="application/ld+json">
your code here
</script>
Hello David,
Thanks for your comment. Does this need to be added to hook? I did, and when testing the code with the rich test result, it returns an error "item not detected."
I
never mind. I figured out.
Glad to hear that!