For us, bloggers may sometimes feel furious when seeing many unimportant comments on our own blog. Moreover, the blog is open to anyon...
For us, bloggers may sometimes feel furious when seeing many unimportant comments on our own blog. Moreover, the blog is open to anyone and no less important is listed form to fill the website. The most likely thing to happen when they know the link in the comment is a DoFollow link. Is it harmful? Yes, it will be very detrimental when visitors enter comments in the form of spam, or comments that are not very useful.
How to Add a Nofollow Link
Before further discussion, let's discuss what is a Nofollow and Nofollow link so you can understand more.
What is Dofollow Link:
DoFollow links are links that can be crawled by search engines (such as Google). So if you put your blog link on a blog that has a DoFollow link, then you will get the profit your blog will be crawled or visited by Google bot, and it will give a back to the back side of your blog.
What is Nofollow Link:
Nofollow links are links that cannot be crawled (crawled) by search engines. This is the opposite of dofollow links.
When visitors who intend to spam or unclear comments know that your blog has a comment with a nofollow link, maybe they will discourage sending comments.
For default the link is shaped like the following code:
<a href="https://www.tipricks.com"> TipRicks </a>
The link is a link called dofollow link.
<a href="https://www.tipricks.com" rel="nofollow" > TipRicks </a>
The link above is a nofollow link marked with rel="nofollow"
Make a Nofollow Link in the Comments
Enter the code below in your theme's functions.php.
[<br />function nofollow($string) {<br />$string = str_ireplace(' rel="nofollow"', '', $string);<br />return $string;<br />}<br />add_filter('comment_text', 'nofollow');<br />]
The code above will change the default link to become a nofollow link. But this is only specific to visitors who enter the link on the website form. For example in sharing comments, if you enter your blog link on the website form then your name will be allowed to point to your blog.
Or you can use the following code.
[<br /> function add_nofollow_link( $link ) {<br /> return str_replace( '")\'>', '")\' rel=\'nofollow\'>', $link );<br /> }<br /> add_filter( 'comment_reply_link', 'add_nofollow_link' );<br /><br />]
The code above will replace all links that visitors enter into the comment to be nofollow links.
This article "How to Add Nofollow Links to WordPress Comments" is protected by
COMMENTS