Home > Uncategorized > Mediawiki spam

Mediawiki spam

I run several sites off Mediawiki, and the spam problem has been getting progressively worse recently.

Making the wiki ‘registered users only can edit’ helps a bit, but most of the spambots can get around that now. In fact most seem to get around the ‘easy rollback’ of recently registered users changes by creating their spamming accounts quite some time before actually using them to spam.

Most of the spam I get is of a particularly useless kind. It’s wrapped in a div set with a style of “overflow:auto;height:1px;”, which makes it invisible on the page. However, as most recent releases of MediaWiki also default to adding a “nofollow” to external links, this means that the spam links get no googlejuice either.

Although useless to the spammer, it’s highly irritating to wiki admins. However, there is a particularly simple fix.

In your LocalSettings.php, just add one line:

$wgSpamRegex="/overflow\s*:\s*auto/i";

Now any attempt to include text that matches in an edit causes the edit to fail.

I’m sure this is documented somewhere, but I only came across it on one of the mailing lists. So I’m offering it out here in the hope that some other plagued mediawiki admin can cut back their admin burden too.

Tags:
  1. March 25th, 2006 at 09:38 | #1

    Thanks for this tip. I will add to my wikis and see if it helps.
    Are you getting good result from this method?

  2. Eric
    March 27th, 2006 at 21:44 | #2

    Hi, I just wanted to drop you a note that this was incredibly useful to me just now – the mediawiki I was just tasked with admin’ing was having a flux of spam of exactly the sort you describe, and I think this edit will take care of it. Thanks!

  3. Ed
    March 28th, 2006 at 14:18 | #3

    Thank you!!

    Before last week, they would attack, disappear, I would clean it, and we’d repeat a month later.

    This week they were very persistent, hitting the same pages over and over.

    Thanks for the salvation!
    Ed

  4. March 28th, 2006 at 23:23 | #4

    Thanks you, this really saved my day. Those suckers really ruined my newly created wiki.

  5. April 2nd, 2006 at 09:37 | #5

    The fix is working perfectly, there hasn’t been a single piece of spam since. I’ve also passed it along to a few other wiki admins. Thank you.

  6. May 3rd, 2006 at 11:21 | #6

    Thank you so much. It was a great help to end this nuisance.

  7. October 11th, 2006 at 07:13 | #7

    Please see http://wiki.evernex.com/index.php?title=Blocking_Spam_in_Mediawiki for a HOWTO on blocking spam in MediaWiki.

    I keep it updated fairly often and run a fairly active small wiki on which I’ve successfully been able to go back to an open edit (no account required) policy. Successful spam attacks in the last 6 months: 0.

  1. March 28th, 2006 at 23:26 | #1
  2. August 25th, 2006 at 09:43 | #2