Site logo

[Resolved] Comments Author URL Issue

Home Forums Support [Resolved] Comments Author URL Issue

Home Forums Support Comments Author URL Issue

  • This topic has 3 replies, 2 voices, and was last updated 5 years ago by Ying.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1799647
    HT

    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>

    #1800510
    Ying
    Staff
    Customer Support

    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 🙂

    #1800599
    HT

    Thank you ..

    OK. Do you think there will be any performance impact because of this change?

    #1800625
    Ying
    Staff
    Customer Support

    I don’t think so 🙂

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.