Archived topic
How to delete nofollow in internal links?
10 replies · Started by Anna on April 9, 2021
Hello. How to remove atribute nofollow in internal links? For example check pls: https://shpargalka.work/wp-content/uploads/2021/04/nofollowinternal.pdf
site: https://shpargalka.work/
Regards
Akena
Hi there,
The theme itself doesn't add nofollow to any links by default.
How and where is that link added?
Hello.
In everyone comments (author link) for example: https://shpargalka.work/garazh/kak-udalit-svoi-foto-iz-yandex/

Hi there,
That's added by WordPress core default templates. The theme doesn't control that.
But to help you out:
You can use this filter:
https://developer.wordpress.org/reference/hooks/get_comment_author_link/
https://github.com/WordPress/WordPress/blob/ad48a153873cdef28ab03c54a034de807e729052/wp-includes/comment-template.php#L241
Example:
add_filter( 'get_comment_author_link', function( $return, $author ){
global $comment;
if ( !empty( $comment->user_id ) && !empty( get_userdata( $comment->user_id )->ID ) ) {
$return = sprintf(
'<a href="%s" rel="external ugc" class="url">%s</a>',
get_author_posts_url( $comment->user_id ),
$author
);
}
return $return;
} );
Thanks
Im copy ypur code and past here? Right?

Hi there,
you cannot add that code in an Element.
This article explains how to add the code:
Hi there,
you cannot add that code in an Element.
This article explains how to add the code:
Im not developer.( Dont understand. I can ask you help for extra charge..?
Simplest option:
1. Install the Code Snippets plugin:
https://en-gb.wordpress.org/plugins/code-snippets/
2. Dashboard > Snippets > Add New.
3. Paste the code Elvin provided in the new snippet
4. Save the Snippet
Thanks
You're welcome