Wiki source code of AntiSpam Techniques

Last modified by Eleni Cojocariu on 2026/10/09 10:51

Hide last authors
Vincent Massol 1.1 1 {{box cssClass="floatinginfobox" title="**Contents**"}}
2 {{toc/}}
3 {{/box}}
4
5 The XWiki project offers several solutions to help fight spam. These are especially useful when XWiki is used as a public site.
6
Vincent Massol 2.1 7 = Correct Permissions =
8
Nikita Petrenko 4.2 9 The first thing to do is to ensure you have not left comments open to anyone, since this will get you a lot of spam.
Vincent Massol 2.1 10
Nikita Petrenko 4.2 11 You should allow the Comment right only to registered users, or at least ask for Captcha for anonymous users (see below).
Vincent Massol 2.1 12
13 Here are some scripts to help you remove comment spam:
Vincent Massol 3.1 14
Vincent Massol 2.2 15 * [[snippets:Extension.Remove All Anonymous Comments]]
16 * [[snippets:Extension.Remove All Comments]]
Vincent Massol 2.1 17
Vincent Massol 1.1 18 = CAPTCHA =
19
Nikita Petrenko 4.2 20 You can enable [[Captchas>>https://en.wikipedia.org/wiki/CAPTCHA]] both on the [[registration screen>>extensions:Extension.Administration Application||anchor="HActivatingcaptchas"]] and for [[comments>>extensions:Extension.Administration Application||anchor="HRights"]].
Vincent Massol 1.1 21
22 You can also use the [[XWiki Catpcha module>>extensions:Extension.Captcha Module]] if you need a tighter integration in your own wiki pages / wiki application.
23
24 = Notifications =
25
Eleni Cojocariu 5.1 26 You can choose to be [[notified>>xwiki:documentation.xs.user.notifications.WebHome]] (even in real time) about changes done to your wiki, and thus be able to quickly revert spam.
Vincent Massol 1.1 27
28 = Delayed Indexing =
29
Nikita Petrenko 4.2 30 You can implement [[Delayed Indexing>>http://c2.com/cgi/wiki?DelayedIndexing]] to discourage spammers. It tells search engines not to 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 page's content and thus is spam-free.
Vincent Massol 1.1 31
Nikita Petrenko 4.2 32 This can be achieved by editing the "HTTP META INFO" section of the [["Presentation" Administration section>>extensions:Extension.Administration Application||anchor="HHTTPMetaInfo"]]. For example, you could decide to wait 5 hours after a page has been created before allowing it to be indexed by using:
Vincent Massol 1.1 33
34 {{code}}
Nikita Petrenko 4.2 35 #if ($datetool.getDate().time - $doc.getCreationDate().time < 5*24*60*60*1000)
Vincent Massol 1.1 36 <meta name=“robots” content=“noindex,nofollow” />
37 #end
38 {{/code}}
39
40 = AntiSpam Application =
41
Nikita Petrenko 4.2 42 Last but not least, you could install the [[AntiSpam Application>>extensions:Extension.AntiSpam Tool Application]], which provides 2 main features:
Vincent Massol 3.1 43
Vincent Massol 1.1 44 * Ability to prevent spam from being entered (by filtering on keywords)
Nikita Petrenko 4.2 45 * UI to easily remove spam content and all content entered by a given user
Vincent Massol 1.1 46
Vincent Massol 2.1 47 = Others =
Vincent Massol 1.1 48
Vincent Massol 2.2 49 * [[snippets:Extension.Delete Spam Users]]

Get Connected