You need to look at my code and edit your code accordingly, before that please read post carefully and create a backup of file functions.php
1.Open the functions.php file in ur current theme and put these code within php tags.
What it will do:
1. Will add ‘no follow’ as rel in url , if comment contains any url.
2. Will ad ‘external’ as rel in url , if comment contains any url.
3. Will add target=”_blank” in comment author’s url so that their web url open’s in new window/new tab as in browser settings
4. Will add target=”_blank” to url, if comment contains any url
5. Wp adds ‘no follow’, ‘external’ rel in comment author’s url by default. So we don’t need to add this 
Code:
function nofollow($text) {
$text = preg_replace('/<a /i','<a rel="nofollow external" ',$text);
$text = preg_replace('/<a /i','<a target="_blank" ',$text);
return $text;
}
function targetblank($text){
$text = preg_replace('/<a /i','<a target="_blank" ',$text);
return $text;
}
add_filter('comment_text', 'nofollow');
add_filter('get_comment_author_link','targetblank');
Good Luck !
27f15103-61c6-4684-8742-7d56c34e80ab|1|5.0
Tips n Tricks
wordpress