Skip to content

Instantly share code, notes, and snippets.

@danielmcclure
Forked from SiR-DanieL/functions.php
Created March 11, 2020 09:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danielmcclure/2e9a91d292ea9fe84572215844b514fb to your computer and use it in GitHub Desktop.
Save danielmcclure/2e9a91d292ea9fe84572215844b514fb to your computer and use it in GitHub Desktop.
/**
* Remove the "nofollow" attribute from all comments author's links
* except for a specific author.
*/
function dofollow_blog_author_comment( $return, $author ) {
if ( $author === 'Your Name' ) {
$return = str_replace( "rel='external nofollow ugc'", '', $return );
}
return $return;
}
add_filter( 'get_comment_author_link', 'dofollow_blog_author_comment', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment