lightweight wiki spam prevention

Stop your wiki getting spammed

This plugin attempts to reduce the instance of Wiki Spam by using the MoinMoin AntiSpamGlobalSolution regex's. Anytime it detects that a saved page contains a string in the regex list, it only refuses to save it.

Major premise is not to create any unnecessary load on the server and not to use excess server resources by holding connections open.

All its processing is only done on save, or on attach. (Foswiki:Extensions/BlackListPlugin does alot of processing on every topic operation, including view)

It uses a timeout on save to check if the list has changed, so if there are no saves, there is no un-needed network traffic. Alternatively the regex list can be loaded by a cron script to minimize save overhead.

To manually update the list, click here

Note that the retrieve of the MoinMoin regex list can still take some seconds which will delay topic saves when the list needs to be refreshed. For best performance:
  • Refresh the list using the rest script from a scheduled cron job
cd [foswiki-bin-directory]
./rest /AntiWikiSpamPlugin/forceUpdate
  • Set the GETLISTTIMEOUT to a very large number so that the cron job will be the only source of updates


The configuration of this plugin is done using the tool. There are 5 settings used to control the operation and agressiveness of the spam filter:

Setting Definition Default
{Plugins}{AntiWikiSpamPlugin}{ANTISPAMREGEXLISTURL} URL containing the public list of regular expressions used to block spam. The default list is provided by MoinMoin.
{Plugins}{AntiWikiSpamPlugin}{LOCALANTISPAMREGEXLISTTOPIC} A topic containing a list of local regular expressions. A sample topic is provided. AntiWikiSpamLocalList
{Plugins}{AntiWikiSpamPlugin}{GETLISTTIMEOUT} Maximum age of the public regular expression list in minutes. When age is exceeded, an updated list will be fetched 60
{Plugins}{AntiWikiSpamPlugin}{BypassGroup} A Wiki group listing members who are permitted to save without any Spam checking. Note that members of the AdminGroup are always permitted to save. AntiWikiSpamBypassGroup?
{Plugins}{AntiWikiSpamPlugin}{HitThreshold} Number of regex hits required to block the save. Set to -1 to simulate operation. 1

Installation Instructions

You do not need to install anything in the browser to use this extension. The following instructions are for the administrator who installs the extension on the server.

Open configure, and open the "Extensions" section. Use "Find More Extensions" to get a list of available extensions. Select "Install".

If you have any problems, or if the extension isn't available in configure, then you can still install manually from the command-line. See for more help.


Edit AntiWikiSpamTestTopic using the Admin user. (This topic is protected against non-admin access.) Save will be permitted, but the matching regular expressions will be logged to the foswiki error log (typically working/logs/error.log)

To cause a true failure, remove the VIEW and CHANGE restrictions to the topic and edit it using a non-admin user.


Author(s): Foswiki:Main.SvenDowideit -
Copyright: © 2005-2009
License: GPL 3 (Gnu General Public License)
Version: 11561 (2011-04-25)
Release: 1.1
Change History:  
25 Apr 2011: Foswikitask:Item1091 - add whitelist,
Foswikitask:Item1580 - also process comments,
Foswikitask:Item10680 - Improve local regex capability
4 Jan 2009: updated for Foswiki v1.0
4 Sep 2007: updated to 4.2
22 Jul 2006: resurected it for TWiki 4.0 due to demand for a low resource AntiSpam? solution
22 Aug 2005: Initial version
Dependencies: None
Home page:

Topic revision: 25 Apr 2011, UnknownUser
This site is powered by FoswikiCopyright © by the contributing authors. All material on this site is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback
Powered by Olark