AntiSpam Techniques

Last modified by Vincent Massol on 2017/09/06

The XWiki project offers several solutions to help fight spam. These are especially useful when XWiki is used as a public site.

Correct Permissions

The first thing to do is to make sure you have not left comments open to anyone since this for sure will get you a lot of spam.

What you should do is either allow the Comment right only to registered users or at least ask for Captcha for anonymous users (see below).

Here are some scripts to help you remove comment spam:


You can enable Captchas both on the registration screen and for comments

You can also use the XWiki Catpcha module if you need a tighter integration in your own wiki pages / wiki application.


You can choose to be informed by mail (even in real time) about changes done to your wiki, and thus be able to quickly revert spam. 

You can also install the IRC Bot Application to get instant IRC notifications when a page in the wiki is modified.

Delayed Indexing

You can implement Delayed Indexing to discourage spammers. It tells search engines to not index pages that were recently updated. On an active wiki, spam will be removed very quickly by community members. Once a page has not been edited for a while, you can assume the community approves of the pages content and thus is spam-free.

This can be achieved by editing the "HTTP META INFO" section of the "Page Element" Administration section. For example you could decide to wait 5 hours after a page has been created before allowing it to be indexed by using:

#if ($datetool.getDate().time - $doc.getCreationDate().time < 5*24*60*60*1000)
<meta name=robotscontent=noindex,nofollow/>

AntiSpam Application

Last but not least, you could install the AntiSpam Application which provides 2 main features:

  • Ability to prevent spam from being entered (by filtering on keywords)
  • UI to easily remove spam content and all content entered by some given user



Get Connected