Archived topic
Comments Author URL Issue
3 replies · Started by HT on May 26, 2021
While replying to comments on each post, this URL is being added for each comment. This URL is not correct. I would like to change it to the correct URL. I have checked 1. gravatar 2.user profile from users (wp-admin) 3.Akismet but couldn't get any clue. Appreciate your reply/help/hint here
Can you help me to understand from where the following data (site URL) is getting fetched
<cite itemprop="name" class="fn"><a href="https://foo.com" rel="external nofollow ugc" class="url">Author one</a></cite>
Hi HT,
This link is added by WordPress, GP has no control over it.
But you can give this PHP a try:
function use_author_link_as_comment_author_url( $url, $id, $comment ) {
if ( $comment->user_id ) {
return get_author_posts_url( $comment->user_id );
}
return $url;
}
add_filter( 'get_comment_author_url', 'use_author_link_as_comment_author_url', 10, 3 );
Adding PHP: https://docs.generatepress.com/article/adding-php/
Let me know :)
Thank you ..
OK. Do you think there will be any performance impact because of this change?
I don't think so :)