Hello,
Thank you for contacting Rank Math and bringing your concern to our attention.
Yes, you can use the filter in the Rank Math free version.
With Rank Math PRO, you can easily add that in the schema via the Schema Templates feature:
https://rankmath.com/kb/schema-templates/
Unfortunately, we don’t have a trial version of Rank Math PRO. However, we offer a 30-day money-back guarantee or a 1-month trial to test the plugin.
Hope that helps.
Thank you.
I’ve tried the filter and it doesn’t seem to work.
add_filter( ‘rank_math/json_ld’, function( $data, $jsonld ) {
// Check if the product schema exists
if ( isset( $data[‘@type’] ) && $data[‘@type’] === ‘Product’ ) {
// Add aggregateRating field to the product schema
$data[‘aggregateRating’] = array(
‘@type’ => ‘AggregateRating’,
‘ratingValue’ => ‘5’, // Replace with your actual rating value
‘reviewCount’ => ’10’, // Replace with your actual review count
);
}
$data[‘@testing’] = array(
‘@type’ => ‘AggregateRating’,
‘ratingValue’ => ‘5’, // Replace with your actual rating value
‘reviewCount’ => ‘1’, // Replace with your actual review count
);
return $data;
}, 99, 2);
If I can get this working as it should work in free version then I will purchase , can you help ?
Hello,
Instead of manipulating the overall schema structure of our plugin, you can selectively tap the product schema by using this filter. Here’s an example on how to use it:
add_filter('rank_math/snippet/rich_snippet_product_entity', function ($entity) {
$entity['aggregateRating'] = [
'@type' => 'AggregateRating',
'ratingValue' => '5',
'bestRating' => '5',
'worstRating' => '1',
'ratingCount' => '10',
];
return $entity;
});
Hope that helps and please do not hesitate to let us know if you need my assistance with anything else.
Thanks for the Reply Jeremy , I tried the filter adding it to the function.php of my Theme but it didnt seem to do anything.
Example URL
https://echomaster-eu.com/product/360-degree-all-round-camera-system/
The code behind is always the same for the schema
script type=”application/ld+json” class=”rank-math-schema”>{“@context”:”https://schema.org”,”@graph”:[{“@type”:”Organization”,”@id”:”https://echomaster-eu.com/#company”,”name”:”Echomaster – Vehicle Safety Solutions”,”logo”:{“@type”:”ImageObject”,”url”:false}},{“@type”:”WebSite”,”@id”:”https://echomaster-eu.com/#website”,”url”:”https://echomaster-eu.com”,”name”:”Echomaster – Vehicle Safety Solutions”,”publisher”:{“@id”:”https://echomaster-eu.com/#company”},”inLanguage”:”en-GB”,”potentialAction”:{“@type”:”SearchAction”,”target”:”https://echomaster-eu.com/?s={search_term_string}”,”query-input”:”required name=search_term_string”}},{“@type”:”ImageObject”,”@id”:”https://echomaster-eu.com/product/360-degree-all-round-camera-system/#primaryImage”,”url”:”https://echomaster-eu.com/wp-content/uploads/2023/04/CAM-360_Image2.jpg”,”width”:1000,”height”:1000},{“@type”:”ItemPage”,”@id”:”https://echomaster-eu.com/product/360-degree-all-round-camera-system/#webpage”,”url”:”https://echomaster-eu.com/product/360-degree-all-round-camera-system/”,”name”:”360-Degree All-Round Commercial Vehicle Camera Solution”,”datePublished”:”2023-04-27T14:41:06+01:00″,”dateModified”:”2023-06-14T15:28:38+01:00″,”isPartOf”:{“@id”:”https://echomaster-eu.com/#website”},”primaryImageOfPage”:{“@id”:”https://echomaster-eu.com/product/360-degree-all-round-camera-system/#primaryImage”},”inLanguage”:”en-GB”},{“@type”:”Product”,”sku”:”CAM-360″,”name”:”360-Degree All-Round Commercial Vehicle Camera Solution”,”description”:”An innovative 360-degree camera system that providing real-time all round views of larger commercial vehicle in a single image.”,”releaseDate”:”2023-04-27T14:41:06+01:00″,”category”:”360 Degree Camera”,”@id”:”https://echomaster-eu.com/product/360-degree-all-round-camera-system/#richSnippet”,”image”:{“@id”:”https://echomaster-eu.com/product/360-degree-all-round-camera-system/#primaryImage”}}]}
Hello,
The filter seems to be working on our test install upon applying it to the Product/WooCommerce Product schema.
Could you please clear your website’s cache and check again?
Meanwhile, please try the different methods in applying the schema and let us know if the aggregateRating is still not getting included:
https://rankmath.com/kb/wordpress-hooks-actions-filters/
If the issue still persists, we might need to take a closer look at the settings. Please edit the first post on this ticket and include your WordPress & FTP logins in the designated Sensitive Data section.
Please do take a complete backup of your website before sharing the information with us.

It is completely secure and only our support staff has access to that section. If you want, you can use the below plugin to generate a temporary login URL to your website and share that with us instead:
https://wordpress.org/plugins/temporary-login-without-password/
You can use the above plugin in conjunction with the WP Security Audit Log to monitor what changes our staff might make on your website (if any):
https://wordpress.org/plugins/wp-security-audit-log/
We really look forward to helping you.
Thank you.
Thank you again for the quick repies,
Jeremy and reinelle it did work in the end it was WP Rocket that had cached the pages and that needed to be refreshed.
I will defiantely have to buy Rank Math now , can I be cheeky and ask if there are any discount codes going at the moment ? I will probably purchase business to start with.
Thanks
Neil
Just noticed guys that on product-categories it doesnt work
https://echomaster-eu.com/product-category/360-degree-camera/
How come the filter doesnt work there ? is there anotherfilter ?
I have purchased the plugin also now 🙂
Hello @neilsteventon,
First of all, thank you for purchasing our plan, you’re support is deeply appreciated.
We also apologize for the delay in response. The next time you create a new ticket, it will be categorized as PRO/Business and will be prioritized 🙂
As for your concern, the product category page doesn’t have product schemas in it hence, the filter didn’t work. However, we don’t recommend adding product schemas to your category pages because this is not a good practice as per Google’s guidelines. The product schema should only be added to a single product page, it wasn’t meant for pages with multiple products.
Hope that helps and please do not hesitate to let us know if you need my assistance with anything else.
Hello @nomansebt-x,
Thank you for reaching out to us.
Can you please confirm if you are using any custom page builder to construct your content and add your links?
Looking forward to helping you.
Is there a way to remove it from those pages ?
Hello,
As we mentioned above, the Product Schema is automatically removed from the category pages by using the setting “Remove Snippet Data” from WordPress Dashboard > Rank Math > Titles & Meta > Product Categories.
This will make sure that the Schema markup on those pages is compliant with Google guidelines and after enabling that is just a matter of time before Google crawls the pages and see the updated markup.
Don’t hesitate to get in touch if you have any other questions.
Awesome thank you so much , I need to get used to the tool and watch some training on this plugin , support has been great.
Cheers
Neil
Hello,
Glad that helped.
If you are looking for a tutorial that covers the entire process of setting up the plugin we recommend this one: https://www.youtube.com/watch?v=cQLvCBVev3I
Thank you.