Fighting Spam on a Wiki

spamThere are a lot of great things about creating a wiki. There is a sense of community and collaboration. People are able to share their knowledge. Depending on how the wiki is set up, anyone can go in and create and edit content. Sounds good, right? Most people are really good and play nicely on The Pet Wiki, but there are a few that I’ve been trying to nip in the bud for some time now. They add links to other sites that have nothing to do with animals. I have no problem allowing links to other pet sites, but no gambling, legal advice or medication please! Here are the strategies that I’ve used to fight spam:

  • No follow: It’s nice to be a good SEO citizen and share the wealth with other good sites out there, but people can and will take advantage. Originally, when I first went out, I allowed search engines to follow all the links in the site. Spammers took advantage of this and stuck all kinds of links to who knows what kinds of sites. Setting the wiki to have “no follow” links reduced the number of new spam links added. To set your wiki to be “no follow,” make sure that $wgNoFollowLinks = true; is set in your LocalProperties.php file.
  • Block: By nature, I hate censorship. It’s just one of those things that you learn in school that sticks with you for life. All that goes out the window when it comes to spammy links. I block those suckers with reckless abandon. Most of the time, what I’m blocking are random IP addresses. I usually give it a time limit, so that if another user coming from the same IP address tries to edit a page, they can still get to it eventually. I also don’t stop new account creation from that IP address for the same reason.
  • AkismetKlick: Akismet is the spam blocker that WordPress uses. They’ve put together a list of naughty spammers, so by adding the AkismetKlick extension for MediaWiki, you’ll be able to block these known culprits. I don’t usually suggest people use experimental extensions, but I’ve been using it now for over half a year without any negative consequences.
  • No more Talk: MediaWiki opens itself up for dicussions on every page. Unfortunately, they also open up a perfect place for spammers to do their dirty work. It was a hard decision to make, but I decided take talk pages out. They were used far more often by spammers than by anyone else. To take them out:
    1. I removed the ablilty to added or edit talk pages by all users by adding:

      $wgGroupPermissions[‘*’][‘edittalk’] = false;
      $wgGroupPermissions[‘*’][‘createtalk’] = false;

      to the LocalProperties.php file

    2. I removed the tab from the skin of the wiki. The first thing to do is add #ca-talk { display:none; } to my main.css. Next, go into your skin.php file. Look for:

      foreach($this->data[‘content_actions’] as $key => $tab) {

      and add the following check:

      if($key != ‘talk’){
      ….
      }

      This will block the talk tab from being written into the HTML page. Note: this is to get rid of the regular page discussions. User talk pages will not be affected.

      Even though I’ve removed these ways for people to communicate to each other, I’ve added some very cool extensions that foster communication and community. I’ll get more into that next time.

The measures that I’ve put in place have nearly completely removed my spam problem. What do you do to get rid of spam from your wiki?