Hello,
I apologize for the inconvenience you are facing while trying to create a custom schema and include the author image. Unfortunately, Rank Math does not provide a specific variable to call the author image directly in the schema creator.
Since Rank Math fetches the author image from Gravatar by default, if you prefer to use a different plugin or method to include the author image in your schema, you may need to manually add the image URL in the schema code using a custom solution.
If you need further assistance or have any other questions, please feel free to ask.
Thank you for raising this concern.
Sources:
How Does the Author Schema Entity Work? » Rank Math
Product Schema Type » Rank Math
How to Use Rank Math’s Custom Schema Generator » Rank Math
Article Schema Type » Rank Math
Setting a Custom Brand for Your WooCommerce Store with Rank Math » Rank Math
Hello,
Could you give me the code?
Thank you.
Hello,
Please share the affected author URL and the image you want to use in the schema so we can check and suggest the code to fetch a different image instead of the gravatar.
You can add the URL in the sensitive data section

It is completely secure, and only our support staff has access to that section.
Looking forward to helping you.
Hello,
I have updated the sensitive data as requested. Can you please check further?
Thank you.
Hello,
Thank you so much for getting in touch.
At the moment, Rank Math doesn’t have a variable to fetch the author’s avatar or profile image URL.
You can however create a custom variable which lets you get that information.
Here’s a custom variable function that we have created for you:
add_action( 'rank_math/vars/register_extra_replacements', function(){
rank_math_register_var_replacement(
'author_avatar', [
'name' => esc_html__( 'Author name', 'rank-math' ),
'description' => esc_html__( 'Author description', 'rank-math' ),
'variable' => 'author_avatar', /* the actual variable: %author_avatar% */
'example' => author_avatar_call_back(),
],
'author_avatar_call_back'
);
});
function author_avatar_call_back(){
$theAuthorId = get_the_author_meta('ID');
$getUserUrl = get_avatar_url ($theAuthorId);
return $getUserUrl;
}
You may refer to this guide on how to add filters to your website: https://rankmath.com/kb/wordpress-hooks-actions-filters/
After adding the filter code to your website, you can add this variable in your schema field: %author_avatar%
.
Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.
Hello,
Thanks for the interest, but it doesn’t work for me in the custom schema.
Besides, when I put a custom schema I also get the default one. In other words, I get two articlenews schemas.
Thanks.
Hello,
We are super happy that this resolved your issue. If you have any other questions in the future, know that we are here to help you.
If you don’t mind me asking, could you please leave us a review (if you haven’t already) on https://wordpress.org/support/plugin/seo-by-rank-math/reviews/#new-post or TrustPilot about your overall experience with Rank Math? We appreciate your time and patience.
If you do have another question in the future, please feel free to create a new forum topic, and it will be our pleasure to assist you again.
Thank you.