Hello,
Thank you for contacting Rank Math and bringing your concern to our attention.
In this case, you can change the name and URL of the author by applying and modifying this code if you are using the Article Schema on your site:
add_filter( 'rank_math/snippet/rich_snippet_article_entity', function( $entity ) {
$entity['review']['author']['name'] = 'New Author Name';
$entity['review']['author']['url'] = 'https://domain.com/about-us';
return $entity;
});
Here’s how you can add a filter/hook to your WordPress site:
https://rankmath.com/kb/wordpress-hooks-actions-filters/
Hope that helps.
Thank you.
Do i need to replace anything in code you provided?
Hello again,
Thank you for your patience.
Yes, you should replace https://domain.com/about-us
with the actual URL of your website’s “About Us” page.
We hope that helps you.
Thank you
To make it happen, do I need to enable author archive?
Hello,
If you use the above filter on your website, you don’t need to enable the Author Archives.
Hope that helps and please don’t hesitate to let us know if you have any other questions.
Thank you.
Hi, I need to modify further details in your article schema. I want to add more entities in it for specifically author section. So, how to add that?
Hello,
You can modify the code we shared before to add additional properties to the author property of the Article Schema. Here is an example:
add_filter( 'rank_math/snippet/rich_snippet_article_entity', function( $entity ) {
$entity['author']['sameAs'] = 'Same As value';
$entity['author']['jobTitle'] = 'Title of the job';
return $entity;
});
Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.
Hello,
Thank you for getting back to us.
You can add the code to your child theme’s function.php
or rankmath.php
file. You can also use a plugin like Code Snippets to add the code. Please follow our guide to for more information on how you can add a filter/hook to your WordPress site: https://rankmath.com/kb/wordpress-hooks-actions-filters/
Hope that helps.
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.