Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+10 votes
in Plugins by

I just added a new plugin which optimizes internal links for better SEO(By removing rel='nofollow' ) in them.

it can also change Rel attribute of external links to nofollow, external, dofollow, etc. so you can enable passing SEO juice to your other sites or credible sites such as wikipedia.

*** this code is in beta version at the moment, use it at your own responsibility and if you have any suggestions or you found any problems with this plugin please send an issue and I'll update it as soon as possible!


get it on Github:


or zip file

Q2A version: 1.6
Hi, thanks for the plugin.
I have one question about it (I've just installed it).
I can read that if I enable it, all internal link relations will be converted to DOFOLLOW.
But I've not found an *internal* link that is created as *NOFOLLOW*.
All the links without rel attribute should be already ok, that is they are already considered as DOFOLLOW.
Can you tell me please an example where a nofollow *internal* link is generated so that the use of this option ("Convert all internal link relations to DOFOLLOW") is justified ? Thanks !
check this link:
it's source is:
<a rel="nofollow" href="http://www.question2answer.org/qa/29001/new-plugin-seo-links">http://www.question2answer.org/qa/29001/new-plugin-seo-links</a>

with this plugin installed on this site and this option enabled, it will remove "nofollow" relation attribute which means it will be considered DoFollow by search engines and your internal link will earn you SEO benefits.
I've just tested it on my 1.6.2 instance.
It does not remove the "nofollow" relation from "local urls" (http://www.mydomain.com). I've tried it with questions, answers and comments.
I have the option "Convert all internal link relations to DOFOLLOW" checked.
Am I doing something wrong ?
this plugin acts while content is posted or edited, so REL values of old posts will not be changed. it's because the process of removing nofollow links is time consuming and if I added it to check each page on load it would greatly slow down the site.
this might be useful for you:
Thanks for reply.
I've tested it with new content, not with old.
that is posting a new question, a new answer or a new comment.
In these posts I've inserted 2 links :
1 "internal" to my q2a instance, 1 to an external site.
With view source I can see that the REL attribute of these 2 links is unchanged (=nofollow)
I see in the code that the search pattern is :

$search = '#<a rel="nofollow" href="' . qa_opt('site_url') . '("|/[^"]*")#i';

while the links in the posts are in the form :

<a href="http://www.website.com" rel="nofollow">

Does the preg_replace find them ?
I've not tested it, just a question...
ok, I wanted to use string editing functions instead of DOM element, but it seems that it's not working for everyone. I'll try to update the plugin in next few days. I'll contact you to see if it's fixed or not.
thank you very much !
I'll test it when ready, I think I'll use it in my website.
I updated it to use DOM to find and change links, if you had any problems contact me directly, so I can check it on your site. cheers
When I upload this plugin i get this error
Fatal error: Can't use method return value in write context in /home/mysite/public_html/qa-include/qa-base.php(510) : eval()'d code on line

Please log in or register to answer this question.