The code snippets in this tutorial remove the default rel="nofollow" from links added in the comment content area as well as the comment author link.
You can use the code to remove the rel="nofollow" completely or change it to rel="external"
Remove No Follow From Comment Author Links
Remove No Follow From Comment Content Text Area Links
Remove rel="nofollow" from comment content text :
Uses str_ireplace
Enable Removal of No Follow From Comment Content Links
This code doesn’t remove the rel="nofollow" attribute from HTML links in comments however its does enable you to remove them manually so you can choose which links are no follow and which are do follow.
Note : The above code only works when adding HTML links with a tags like this
<a href="example.com">Link</a>
but doesn’t remove nofollow when adding text links like this
https://example.com
Remove No Follow From Raw Text Links
The following code removes the rel="nofollow" attribute from raw text links which are added to comments.
So links added to comments like this :
https://example.com
Which WordPress would turn into this :
<a href="https://example.com" rel="nofollow">https://example.com</a>
Now become this :
<p>https://example.com</p>






Leave a Reply