Skip to content


Rel=nofollow in MyBB’s links

Yesterday I had to do some cleaning on the low-traffic Wiki4Games BBS, running MyBB. Basically the spammers registered accounts which never posted (so I barely noticed those account creations) and had a few (usually 1 or 2) spam links in their signature. In case you start thinking a spam signature is harmless as long as you don’t post with it, let me remind you that the signature appears on the user’s profile. So it gets seen by you-know-who-who-browses-everywhere. I found a MyBB mod to nofollow user websites, but no equivalent for signatures. I don’t think it’s easily feasible to nofollow specifically the links in the signature, so I went for the parser, i.e. I tried to nofollow all links posted within a [url] tag (NB: this also works on URLs posted without the url tag, as long as they’re identified as url by the parser). No further ado, here it is:

  • Open inc/class_parser.php
  • In function mycode_parse_url, find:
    $link = "<a href=\"$fullurl\" target=\"_blank\">$name</a>";
  • Replace it with:
    $link = "<a href=\"$fullurl\" target=\"_blank\" rel=\"nofollow\">$name</a>";

Save, upload, and you’re done.

As for the website URL from the website field, well, do as indicated on this tutorial, which summarizes as: add rel=nofollow in the postbit_www template. Or, better (this will also deal with the website on the user profile page and not just on the “www” button), install the previously mentionned NoFollow Website Links extension.

Posted in MyBB, web development.


0 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.



Some HTML is OK

or, reply to this post via trackback.

Please solve the CAPTCHA below in order to fight spamWordPress CAPTCHA