Hello,
Thank you for contacting Rank Math today.
You can’t right now since it is not an option offered (yet) by Rank Math but I dod for you the following code, you can add it at the end of your functions.php file (in your active theme) and customize it by adding your URLs and it should work for you:
/**
* Collect data to output in JSON-LD.
*
* @param array $unsigned An array of data to output in json-ld.
* @param JsonLD $unsigned JsonLD instance.
*/
add_filter( 'rank_math/json_ld', function( $data, $jsonld ) {
if(is_singular('listing')){
$currentSameAs = $data['Organization']['sameAs'];
$currentSameAs[] = "https://wordpress url....";
$currentSameAs[] = "https://blogger url....";
$currentSameAs[] = "https://tumblr url....";
// And so on...
$data['Organization']['sameAs'] = $currentSameAs;
return $data;
}, 10, 2);
Looking forward to helping you. Thank you.
Thanks, man! But when updating the theme it will vanish, right?
Any way to keep it there? Child theme is the only way?
And it will only be editable by code, right? Will not appear anywhere on the plugin, it will just inject itself on the right place, that’s it?
Thanks
Hello,
You can add a child theme so any code you add to the functions.php in the child theme won’t be lost when updating the theme.
If you are worried about using the child theme because you would need to do all the theme customization again, you could follow this guide to do it easily: https://kairaweb.com/documentation/migrate-your-theme-settings-to-a-child-theme/
About doing it just by code, yes, for now, it is an “advanced function” so it can only be done using the code but as you say, it will be injected in the right places.
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.