Hello,
Thank you for contacting Rank Math and bringing your concern to our attention. I’m sorry for any inconvenience this issue may have caused you.
Yes, you would need to paste that in rank-math.php file in your theme’s folder.
However, please note that you may need to edit/customize the filter further to apply the positiveNotes and negativeNotes to each of your products’ schema.
Here’s a sample filter to target the product schema specifically and add the positiveNotes to get you started:
add_filter( "rank_math/snippet/rich_snippet_product_entity", function( $entity ) {
$entity['review']['positiveNotes'] = [];
$entity['review']['positiveNotes']['@type'] = 'ItemList';
$entity['review']['positiveNotes']['itemListElement'][] = [
'@type' => 'ListItem',
'position' => 1,
'name' => 'Useful'
];
return $entity;
});
Hope that helps.
Thank you.
Hello,
Thanks for your answer.
Where exactly should I edit/customize the filter to apply the positiveNotes and negativeNotes to each of my products’ schema ?
Hello,
You may need to customize/edit the code itself so you can achieve the positiveNotes and negativeNotes to be applied to the product schema.
Unfortunately, customizing the filter further is already out of our scope of support. To further customize the code, you can hire someone on Fiverr.com or any other freelancing website for them to achieve that on your website.
Looking forward to helping you.
Thank you.
Hello,
Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.
If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.
Thank you.