Hello,
These schema properties are essential for the search engine especially the breadcrumbs as this will guide the search engine about the structure of your website.
With that said, you may refer to this filter code to apply the breadcrumbs only to posts:
add_filter( 'rank_math/snippet/breadcrumb', function( $entity ) {
if ( !is_singular( 'post' ) ){
return false;
}
return $entity;
});
Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.
Hello,
Thanks for the reply to the breadcrumbs.
On the other hand, how can I remove the duplicate property name for the author?
Thanks
Hello,
We generate a schema to be compliant with Google’s documentation so having multiple name properties will not cause any issues.
However, you can modify the schema by using this filter code:
https://rankmath.com/kb/filters-hooks-api-developer/#change-post-schema-data
Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.
Sorry, but the answer has nothing to do with my problem.
Have you reviewed the page with my problem? It seems not.
Hello,
Here’s a filter to remove or change the name property from the author schema:
add_filter( 'rank_math/snippet/rich_snippet_article_entity', function($entity) {
// Change
$entity['author'] = [
'@type' => 'Person',
'name' => 'Author Name',
'@id' => 'https://mywebsite.com/other-url-custom'
];
// Remove
unset($entity['author']['name']);
return $entity;
});
Please note that as the structure is already valid, removing the property may cause warnings or errors from Rich Result Test.
Hope that 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.