Hello,
Thank you for contacting Rank Math support, and sorry for any inconvenience that might have been caused due to that.
You need to replace the curly brackets with squared ones. Please refer to my filter below instead:
add_filter( 'rank_math/json_ld', function( $data, $jsonld ) {
if ( isset( $data['publisher'] ) ) {
$data['publisher']['employees'] = [
[ "firstName" => "John", "lastName" => "Doe" ],
[ "firstName" => "Anna", "lastName" => "Smith" ]
];
}
return $data;
}, 99, 2 );
Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.
Hello again! Do you know why I see it twice? https://ibb.co/DVb8DWY
I used this code:
add_filter( 'rank_math/json_ld', function( $data, $jsonld ) {
if ( isset( $data['publisher'] ) ) {
$data['publisher']['employees'] = [ "firstName" => "DelfĂn", "lastName" => "GarcĂa Blanco" ];
}
return $data;
}, 99, 2 );
Thanks!
Hello,
It seems that you already marked this ticket as “Resolved”.
Do you still need our assistance regarding this issue? If you are, can you please ensure that you didn’t add the filter code twice on your website?
Also, please share the affected URL so we can further check it from our end.
Looking forward to helping you.
Thank you.