Hello,
Thank you for contacting Rank Math.
You can try the following filter to remove the author information from the Schema of products and pages.
add_filter( 'rank_math/json_ld', function( $entities, $jsonld ) {
if ( ! is_singular( 'product' ) && ! is_singular( 'page' ) ) {
return $entities;
}
if ( isset( $entities['ProfilePage'] ) ) {
$id = $entities['ProfilePage']['@id'];
foreach ( $entities as $key => $entity ) {
if ( isset( $entity['author' ]['@id'] ) && $id === $entity['author' ]['@id'] ) {
unset( $entities[ $key ]['author'] );
}
}
unset( $entities['ProfilePage'] );
}
return $entities;
}, 999, 2 );
You need to add the filter in the theme’s functions.php file.
Here is a guide for your reference:
https://rankmath.com/kb/wordpress-hooks-actions-filters/
I hope this helps.
Thank 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.