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

1 Answer

0 votes

Great plugin @QA-Themes ! But I noticed something that's intriguing me.
For example, when a user insert a link on a question/answer or whatever like this:

<a rel="dofollow" href="http://www.question2answer.org/qa" target="_blank">question2answer</a>

after publishing it, the output of this link will be like this:

<a rel="dofollow nofollow" href="http://www.question2answer.org/qa" target="_blank">question2answer</a>

and I'm not sure if this will make a "dofollow" for this link or if it's going to do a "nofollow". I'm concerned about this because people can use this method to create spam links or create dofollow links for adult sites for example and that's not very nice. Should I be concerned about this? what's the rel tag that is going to be read or the one that's going to be "followed" anyways?

it shouldn't normally happen. are you using "Q2A Ultimate SEO" as well as this plugin? if not try mentioned plugin to see if you get same result too.
I no longer support this plugin, as it's features already exists in my more comprehensive plugin "Q2A Ultimate SEO". also some bugs in this module was fixed in it too.
No, I am using this one - "SEO Links".
I'm gonna try and delete that plugin and use only the "Q2A Ultimate SEO" to see if this problem persists