Hello @atoris
Thank you for contacting the support.
You can add the following filter to your theme’s functions.php file. The filter will only work on the frontend. We don’t have any filter or an option to autofill the values in admin area.
add_filter( 'rank_math/json_ld', function( $json_ld, $json ) {
if ( is_singular() && ! isset( $json_ld['richSnippet'] ) ) {
$post_id = $json->post_id;
$json_ld['richSnippet'] = [
'@context' => 'https://schema.org',
'@type' => 'VideoObject',
'name' => $json->parts['title'],
'description' => $json->parts['desc'],
'uploadDate' => get_post_meta( $post_id, '_meta_key', true ),
'duration' => get_post_meta( $post_id, '_meta_key', true ),
'contentUrl' => get_post_meta( $post_id, '_meta_key', true ),
'embedUrl' => get_post_meta( $post_id, '_meta_key', true ),
'interactionCount' => get_post_meta( $post_id, '_meta_key', true ),
'thumbnailUrl' => get_post_meta( $post_id, '_meta_key', true ),
];
}
return $json_ld;
}, 11, 2);
Please stay advised that this code will only work on the posts where snippet was not selected.
If you want to overwrite it in all posts then you will have to remove && ! isset( $json_ld['richSnippet'] )
from the if condition.
Hope that helps. If you have any further question(s), please let us know.