-
Hello Rank Math Support Team,
I’m currently configuring structured data for my digital product store using Rank Math, and I would like to confirm the best schema types to use in the following areas:
Post & Pages (under Title & Meta > Posts):
What is the recommended default schema type to use for these post pages in the context of a digital product store?Product Category Pages (Collection of Digital Products):
Each product category page on my site represents a collection of related digital products. What is the best schema type for these pages?Best,
Dhruvi
-
Hello,
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.
Hello,
I have updated the sensitive data as requested. Can you please check further?
Thank you.
The access has been granted and added under sensitive data. Please complete it within one week, otherwise it will expire.
Hello,
Sorry for the delay.
Checking your website, you are currently using the “Easy Digital Downloads – Reviews” plugin, which is not supported by our plugin so the aggregateRating isn’t generated. You will have to contact the support folks from EDD and request that they integrate their review data into our schema structure using our filter code like how we do it with judge.me: https://support.rankmath.com/ticket/reviews-are-disabled-on-this-product/?view=all#post-431335
Let us know how that goes.
The URL you shared is currently not accessible.
Hello,
Sorry about that. You should be able to access the ticket now.
Looking forward to helping you.
Hello Team,
I reached out to the Easy Digital Downloads team as per your suggestion, and here’s what they shared with me:
“The Reviews plugin is adding JSON-structured data to the default EDD product data automatically, and the aggregateRating is available there.
I’m not familiar with the Rank Math plugin, so it might be worth asking their team to see how that can be added.
The ‘aggregateRating’ can be found inside the main edd-reviews.php plugin file and also under classes/class-edd-reviews-json-ld.php.”Could you please say how to integrate this with Rank Math schema so that the aggregateRating is properly generated?
Hello,
We checked the page source, and there’s currently no
aggregateRatingoutput in your website, so we aren’t sure how the review data is stored or retrieved by their plugin. Once you’re able to fetch the review data (for example, the rating value and count), you can easily integrate it into Rank Math’s Product schema using the following filter:add_filter('rank_math/snippet/rich_snippet_product_entity', function ($entity) { $entity['aggregateRating'] = [ '@type' => 'AggregateRating', 'ratingValue' => YOUR_RATING_VALUE_HERE, 'bestRating' => '5', 'worstRating' => '1', 'ratingCount' => YOUR_RATING_COUNT_HERE, ]; return $entity; });This will inject the rating data into Rank Math’s Product schema once the correct values are passed.
Let us know once you have access to the rating data, and we’ll be happy to help you integrate it further.
Looking forward to helping you with this one.
We can get the shortcode from EDD for the review. Would you be able to use that to store the review data in the schema?
Hello,
Sorry, our filter code doesn’t support reading the contents from a shortcode. The data must be coming from a meta field or a custom database table. We suggest checking with EDD support on this one.
Looking forward to helping you.
Hi Jeremy,
I’m Darshan from the technical team, following up on the earlier discussion with Dhruvi.
We’ve contacted the EDD team regarding this issue, and they’ve provided the following working code snippet to integrate the review data into the Rank Math product schema:
add_filter(‘rank_math/snippet/rich_snippet_product_entity’, function ($entity) {
// Check if EDD Reviews plugin is active
if ( ! class_exists( ‘EDD_Reviews’ ) || ! function_exists( ‘edd_reviews’ ) ) {
return $entity;
}
// Get the current product/post ID
$post_id = get_the_ID();
if ( ! $post_id ) {
return $entity;
}
// Get average rating from EDD Reviews
$average_rating = edd_reviews()->average_rating( false, $post_id );// Get review count from EDD Reviews
global $post;
$original_post = $post;
$post = get_post( $post_id );
$rating_count = edd_reviews()->count_reviews();
$post = $original_post;// Add AggregateRating data if available
if ( ! empty( $average_rating ) && $rating_count > 0 ) {
$entity[‘aggregateRating’] = [
‘@type’ => ‘AggregateRating’,
‘ratingValue’ => (string) $average_rating,
‘bestRating’ => ‘5’,
‘worstRating’ => ‘1’,
‘ratingCount’ => (string) $rating_count,
];
}
return $entity;
});Please review this snippet and let us know if it aligns with Rank Math’s filter implementation for including EDD review data in the structured schema.
Looking forward to your confirmation or any further adjustments you recommend.
Hello,
Thank you for reaching out to us and thank you for sharing the snippet.
Yes, this implementation aligns perfectly with Rank Math’s filter structure for adding AggregateRating data to the Product Schema.
Please go ahead and test it using Google’s Rich Results Test to ensure the structured data is being parsed correctly.
Looking forward to helping you.
Hello,
Thank you for confirming. We appreciate your quick response and guidance. We’ll proceed with implementing the snippet and verify it using Google’s Rich Results Test.
Hello,
You’re welcome. Glad we could help.
Please let us know if you encounter any issues during testing or need further assistance.
We’re here to support you.
Thank you.
You must be logged in to reply to this ticket.