Remove comment author links of widgets but keep in single posts

My problem is that I want to remove the links-author just in the recent comments widget in my sidebar, but still show him in the comments area of the posts.

I want to do this to have a better SEO in the theme structure.

function recents_comments_output_change( $url, $id) {

    $url = get_comment_link($id);
    return $url;

add_filter( 'get_comment_author_url', 'htron_recents_comments_output_change', 10, 3);

This code removes the links-author of all comments in the site and replace it with the comment-link of the comment.

I think that I have to check this as a widget with a conditional if, or check if it is in the comment area, but I can't think a way to do that, so if someone can help I will be grateful.

if there is no way to do that with a wordpress function I will try with Javascript.