Hello,
Thank you for contacting Rank Math and bringing your concern to our attention. I’m sorry for the delay and for any inconvenience this issue may have caused you.
The code you shared, has a little issue, here I am sharing the correct one. But remember, this code will work only for the article
object. So please be careful for which object type you want to remove the author field.
/**
* Filter to change the schema data.
* Replace $schema_type with schema name like article, review, etc.
*
* @param array $entity Snippet Data
*
* @return array
*/
add_filter( "rank_math/snippet/rich_snippet_article_entity", function ( $entity ) {
if ( isset( $entity['author'] ) ) {
unset( $entity['author'] );
return $entity;
}
return $entity;
} );
If you require any further assistance don’t hesitate to get in touch. Thanks
Hello,
I have updated the sensitive data as requested. Can you please check further?
Thank you.
Hello, thank you for your reply. I see that I keep getting error in the author field in the google schema tool.
I would need it to either not identify that field, so it doesn’t think the tag is empty, or it would take the information in the same way the template does.
I send you the link to the test as hidden content, so you understand what I mean. I don’t understand why the author field inside the article gives error.
Hello,
Thank you for the follow-up, and sorry for the delay.
I’ve checked the URL using Google’s Rich Results test, and it seems that it is already working fine.
The Structured Data Testing Tool is being deprecated. For validating structured data for Google Search, Google now recommends using the Rich Results Test for more accurate and actionable feedback.
I hope that helps. Thank you, and please don’t hesitate to contact us anytime if you need further 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.