There is a more versatile way to get rid nofollow blog without editing files engine. It is based on the use of the filter, which is written in the file functions.php. Open this file and add the following lines:
function comment_author_link_follow_innewwindow () {
global $ comment;
$ url = get_comment_author_url ();
$ author = get_comment_author ();
if (empty ($ url) || 'http: //' == $ url)
$ return = $ author;
else
$ return = "<a href='$url' rel='external' target='_blank'> $ author </a>";
return $ return;}
add_filter ('get_comment_author_link', 'comment_author_link_follow_innewwindow');
This filter removes the nofollow links to the authors' comments that lead to their websites. And to remove the nofollow links in the text of the comment and the text of posts, add a filter:
function remove_nofollow ($ string)
{$ string = str_ireplace ('rel = "nofollow"', '', $ string);
return $ string;}
add_filter ('the_content', 'remove_nofollow'); // Remove the nofollow for texts of posts
add_filter ('comment_text', 'remove_nofollow'); // Remove the nofollow for comments in text
If you have not used a rel = "nofollow", and rel = "external nofollow", then you need to add another filter:
function remove_nofollow ($ string)
{$ string = str_ireplace ('rel = "external nofollow"', '', $ string);
return $ string;}
add_filter ('the_content', 'remove_nofollow'); // Remove the nofollow from texts in posts
add_filter ('comment_text', 'remove_nofollow'); // Remove the nofollow for comments
How to remove NoFollow from posts and comments in WordPress themes?
To do this, just need to open the file function.php site template and write in it the following code:
function remove_nofollow ($ string) {
$ string = str_ireplace ('rel = "nofollow"', '', $ string);
return $ string;}
add_filter ('the_content', 'remove_nofollow');
add_filter ('comment_text', 'remove_nofollow');
Posted by Rose Tyler