Hello,
Thank you for contacting Rank Math and for sharing this suggestion.
I will pass this on to our dev team so that the feature can be considered for development on our future development roadmap.
For now, you can seek the help of a developer to extend the Rank Math schema with the additional attributes by using the following filter:
/**
* 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 ) {
return [];
}, 10, 2);
Looking forward to helping you. Thank you.
Hi! Please help with the logic for this filter.
How to add ‘founder’? Please provide a working code?
add_filter( ‘rank_math/json_ld’, function( $data, $jsonld ) {
$data[‘Organization’] = [
‘founder’ => ‘TEST’,
];
return $data;
}, 10, 2);
Does not work!
Hello,
Thank you for contacting Rank Math today.
The following is a sample of how you could use it.
add_filter( 'rank_math/json_ld', function( $data, $jsonld ) {
// IF STATEMENT TO TEST IF LOCAL BUSINESS SCHEMA IS EXIST ON THE PAGE BEFORE ADDING THE EXTRA FIELDS
$data['LocalBusiness'] = [
'@context' => 'https://schema.org',
'@type' => 'LocalBusiness',
'@id' => 'https://abc.com/#organization',
'founder' => 'Test'
];
return $data;
}, 10, 2);
Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.
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.