Hello,
Thank you for getting in touch with us.
You can customize the following filter to change front end schema.
**
* 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. If you have any further question(s), please let us know. Thank you.
Thanks for your reply.
I’m not sure where to put and how to use this code?
Hello,
The following is a sample application. Unfortunately if you are not good in programming you will have to seek help from one to customize this.
**
* 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_article_entity", function( $entity ) {
$thisName = /*your field value*/;
$entity['article'] = [
'name' => $thisName,
];
return $entity;
});
Looking forward to helping you. Thank you
Yes, I think I’m not good enough to understand it. 😅
Except using a sample application like this, there is no way to create dynamic default values for rich snippets fields ?
Thank you for your help !
Hello,
Right now, no. But I will submit that suggestion to our devs since I think you got a really good idea, thank you!
Looking forward to help you.
Thanks ! Hope it will come soon as it can make us save a lot of time ! 🙂
Hello,
I completely agree with you, it sounds like a really nice feature! Meanwhile, do you want we set the thread as solved? Don’t worry, we will be still here to help you with any other questions or issues you might have in the future.
Looking forward to help 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.