Hello @dibbyo456
If you still want to use the data from the settings as the fallback then please add the following code in the functions.php file:
add_filter( 'rank_math/json_ld', function( $json_ld, $json ) {
if ( is_singular() && ! isset( $json_ld['richSnippet'] ) && $fallback_schema = \RankMath\Helper::get_settings( "titles.pt_{$json->post->post_type}_default_rich_snippet" ) ) {
$json_ld['richSnippet'] = [
'@context' => 'https://schema.org',
'@type' => \RankMath\Helper::get_settings( "titles.pt_{$json->post->post_type}_default_article_type" ),
'headline' => $json->parts['title'],
'description' => $json->parts['desc'],
'datePublished' => $json->parts['published'],
'dateModified' => $json->parts['modified'],
'publisher' => $json->get_publisher( (array) $json->post ),
'mainEntityOfPage' => [
'@type' => 'WebPage',
'@id' => $json->parts['canonical'],
],
'author' => [
'@type' => 'Person',
'name' => $json->parts['author'],
],
];
$json->add_prop( 'thumbnail', $json_ld['richSnippet'] );
}
return $json_ld;
}, 11, 2);
Hope that helps. Thank you.