Hi @shahkb4 ,
Thank you for using PublishPress.
Could you tell what is the theme that you apply to your site?
Then, could you also point out the post in your site that is having the issue?
If you could take a screenshot and point it out using arrow, it will set us on the same page more efficiently.
Hi the theme name is Foxiz.
We’re facing a critical issue where the author’s person schema shows a different name. While checking further, we found that RankMath fetches data from PublishPress and gets values from the image caption. The problem is that the caption is not present at all with the selected image. You can check that in the person schema, the name is coming differently due to the wrong image caption provided by PublishPress as soon as we turn off PublishPress, the issue resolves. We’re using a Simple Local Avatars plugin, but it’s not impacting whether it’s on or off.
You can check the issue here: https://prnt.sc/q7BrlBiYV6Z_
Thank You
Hi @shahkb4 ,
Thank you for the details.
Are you trying to make the name that is coming to be the same as the caption? Can you also point out which wrong image caption that you refer to?
Yes, the name is coming from the image caption and the caption is being fetched from the publishpress. Even after changing the image the caption remains there. Can you help to deattach rankmath integration for this thing? This issue is happening only in a few authors only. I have already tried changing the profile image options.
Issue goes away as soon as i disable publishpress but it’s not an option. Is there any way to fix this?
I found the exact spot:
File:
publishpress-authors/src/modules/rank-math-seo-integration/rank-math-seo-integration.php
Line: ~115
'caption' => $author->display_name,
This is where PublishPress Authors sets the caption field in the Person schema’s image object to the author’s display name.
On author archives, because of how they determine $author, this sometimes ends up being a co-author from a post, not the queried profile author — that’s why it’s coming wrong.
options now:
Remove it entirely:
// 'caption' => $author->display_name,
Or replace $author->display_name with a function that gets the queried author:
'caption' => is_author() ? get_queried_object()->display_name : $author->display_name,
Thank You