Hello,
Thank you for contacting Rank Math.
You can use this filter to add sameAs property:
add_filter( 'rank_math/json_ld', function( $data, $jsonld ) {
if ( isset( $data['publisher'] ) ) {
$data['publisher']['sameAs'] = ['https://twitter.com/RankMath', 'https://facebook.com/....'];
}
return $data;
}, 99, 2 );
Hope that helps.
Thank you.
Hello again, that code works for organization but not for author. I would like to add sameAs just for author.
Like in this image: https://ibb.co/dDhfzBC
Thanks!
Hello,
Please refer to this filter code instead:
add_filter( 'rank_math/snippet/rich_snippet_article_entity', function($entity) {
if($entity['author']){
$entity['author']['sameAs'] = [
'https://twitter.com/RankMath',
'https://facebook.com/...'
];
}
return $entity;
});
See if this helps you with your goal.
Looking forward to helping you on this one.
Hello,
We are super happy that this resolved your issue.
If you have other issues/questions in the future, please feel free to create a new forum topic, and it will be our pleasure to assist you again.
Thank you.