Hello,
Thank you for contacting Rank Math.
You can modify and use this filter:
/**
* Filter to change the schema data.
* Replace $schema_type with schema name like article, review, etc.
* @param array $entity Snippet Data
* @return array
*/
add_filter( "rank_math/snippet/rich_snippet_{$schema}_entity", function( $entity ) {
return $entity;
});
Hope that helps.
Thank you.
OK thanks, I think that’s clear…
So, after swapping out {$schema} with a particular schema name, $entity is an array containing all parameters, and that can just be adjusted before returning?
Hello,
Yes, you understood correctly. Please check this screencast of the the filter applied to article schema with a an extra line of code for debugging so you can view the contents of $entity: https://i.rankmath.com/H5fnMu
The code snippet used in the screencast:
add_filter( "rank_math/snippet/rich_snippet_article_entity", function( $entity ) {
echo "<pre>", var_dump($entity), "</pre>"; // this line is for debugging. Remove if using on a live website
return $entity;
});
Hope that helps. Please let us know if you have questions.
Hello,
We are super happy that we could address your concern. If you have any other questions in the future, know that we are here to help you.
If you don’t mind us asking, could you please leave us a review (if you haven’t already) on https://wordpress.org/support/plugin/seo-by-rank-math/reviews/#new-post about your overall experience with Rank Math? We appreciate your time and patience.
If you have another question in the future, please feel free to create a new forum topic, and it will be our pleasure to assist you again.
Thank you.