MediaWiki extensions manual
Release status: experimental
Implementation Page action
Description Rejects edits from suspected comment spammers on Akismet's blacklist.
Author(s) Carl Austin Bennett (Carlbtalk)
MediaWiki 1.23+
PHP 5.3+
License BSD 2-clause "Simplified" License
  • $wgAKkey
  • $wgAKSiteUrl
Quarterly downloads 0
Translate the AkismetKlik extension if it is available at translatewiki.net
Issues Open tasks · Report a bug

The AkismetKlik extension rejects edits identified as being from comment spammers. It uses Akismet, an adaptive spam-filtering service originally devised by WordPress for use by blog hosts.



This extension requires PHP5 and uses the Akismet.class library, available here.

Installation steps:

  1. Save Akismet.class.php to the AkismetKlik folder.
  2. Download the source for the AkismetKlik.php extension into the AkismetKlik folder.
  3. Obtain a WordPress API key by registering as a user on http://wordpress.com (WordPress.com not WordPress.org)
  4. Edit AkismetKlik.php to customise the following configuration variables to match your sitename and ten-digit API key, for instance:
    $wgAKkey='867-5309'; // Jenny's personal API key at wordpress.org - keep this secret!
    $siteURL='http://wiki.example.org'; // URL of the local wiki, $wgArticlePath is assumed to be /wiki/$1 under this
  5. Add the 'bypassakismet' right to certain groups in LocalSettings.php to allow them to bypass this filter completely
    $wgGroupPermissions['autoconfirmed']['bypassakismet'] = true;
    $wgGroupPermissions['sysop']['bypassakismet'] = true;
    $wgGroupPermissions['bot']['bypassakismet'] = true;
  6. Include the extension from LocalSettings.php using:
    require_once( "$IP/extensions/AkismetKlik/AkismetKlik.php" );



Akismet's servers are configured to flag all edits from User:Viagra-test-123 as unconditionally spam. Edit a page while logged out (or logged in as a different user) and the wiki should respond normally; attempt to edit while logged in under a test account User:Viagra-test-123 and every attempt should be rejected with a Spam Filter error.



This extension has been tested against the current MediaWiki release only; its compatibility with other versions of MediaWiki is unknown although it likely can be adapted in some form.

This extension does not currently provide a means to handle (or to report) false-positive or false-negative results. There are functions in the Akismet.class library to "report as spam" or "report as ham", but this extension does not make this functionality available to wiki admins.

There is also no direct MediaWiki equivalent to WordPress's capability to store suspected spam comments for later manual review. As such, text which triggers false-positive results cannot be edited or saved.

A group can be given the 'bypassakismet' right to bypass the filter completely. This could be used to allow bots, sysops or even all autoconfirmed users to edit without the false-positives this filter can return.

The page title (MW 1.12 only) is passed to Akismet in the "permalink" field and the URL field is populated based on the first external link found in the message body. It may make more sense to change the submitted query to use the wiki edit comment field data in some manner - most likely by re-purposing an existing field, given that the field names are based on WordPress' design, not wiki.

See also




The PHP5 code structure is based loosely on that of existing extension code, specifically Extension:SpamBlacklist, which is open-source under the GPL.