Hello @nalitana
Thank you for contacting the support.
Since Google’s tool is accepting the current Schema Markup, please use the following filter in your theme’s functions.php file to make it compatible with Yandex as well:
add_filter( 'rank_math/json_ld', function( $data, $jsonld ) {
$parts = [];
if ( isset( $data['CollectionPage'] ) ) {
unset( $data['CollectionPage']['hasPart'] );
while ( have_posts() ) {
the_post();
$post_id = get_the_ID();
$schema = RankMath\Helper::get_post_meta( 'rich_snippet', $post_id );
if ( ! $schema || 'article' !== $schema ) {
continue;
}
$title = $jsonld->get_post_title( $post_id );
$url = $jsonld->get_post_url( $post_id );
$parts[] = [
'@type' => isset( $data['schema'] ) ? $data['schema'] : $schema,
'headline' => $title,
'name' => $title,
'url' => $url,
'mainEntityOfPage' => $url,
'dateModified' => get_post_modified_time( 'Y-m-d\TH:i:sP', true ),
'datePublished' => get_post_time( 'Y-m-d\TH:i:sP', true ),
'author' => $jsonld->get_author(),
'publisher' => $jsonld->get_publisher( $data ),
'image' => $jsonld->get_post_thumbnail( $post_id ),
'keywords' => $jsonld->get_post_terms( $post_id ),
'commentCount' => get_comments_number(),
'comment' => $jsonld->get_comments( $post_id ),
'wordCount' => str_word_count( get_the_content() ),
];
}
wp_reset_query();
$data['CollectionPage']['hasPart'] = $parts;
}
return $data;
}, 99, 2);
Hope that helps.