Extension:ConfirmEdit - MediaWiki
Jump to content
From mediawiki.org
Translate this page
Languages:
Türkçe
català
italiano
polski
português
sicilianu
čeština
русский
العربية
中文
MediaWiki extensions manual
ConfirmEdit
Release status:
stable
Implementation
Page action
Description
Adds CAPTCHAs for page saves and other user actions
Author(s)
Brooke Vibber
Florian Schmidt
Sam Reed
Latest version
1.6.0 (Continuous updates)
Compatibility policy
Snapshots releases along with MediaWiki. Master is not backward compatible.
Parameters
$wgCaptchaBadLoginPerUserAttempts
$wgConfirmEditLoadedCaptchas
$wgCaptchaRegexes
$wgCaptchaBypassIPs
$wgHCaptchaDeveloperMode
$wgHCaptchaUseRiskScore
$wgHCaptchaProxy
$wgHCaptchaSiteKey
$wgCaptchaTriggersOnNamespace
$wgHCaptchaApiUrlIntegrityHash
$wgHCaptchaVerifyUrl
$wgHCaptchaEnterpriseHealthCheckApiUrlRetryCount
$wgHCaptchaApiUrl
$wgCaptchaBadLoginAttempts
$wgHCaptchaEnabledInMobileFrontend
$wgCaptchaStorageClass
$wgCaptchaSessionExpiration
$wgHCaptchaEnterpriseHealthCheckSiteVerifyErrorThreshold
$wgHCaptchaSecureEnclave
$wgHCaptchaSendRemoteIP
$wgCaptchaTriggers
$wgHCaptchaInvisibleMode
$wgHCaptchaEnterpriseHealthCheckApiUrlErrorThreshold
$wgConfirmEditEnabledAbuseFilterCustomActions
$wgCaptchaBadLoginPerUserExpiration
$wgCaptchaAbuseFilterCaptchaConsequenceTTL
$wgHCaptchaEnterpriseHealthCheckApiUrlRetryDelayMs
$wgCaptchaBadLoginExpiration
$wgHCaptchaSecretKey
$wgCaptchaClass
$wgHCaptchaEnterpriseHealthCheckFailoverDuration
$wgHCaptchaEnterprise
$wgHCaptchaCSPRules
$wgHCaptchaVisualEditorOnLoadIntegrationEnabled
$wgCaptchaIgnoredUrls
Added rights
skipcaptcha
Hooks used
APIGetAllowedParams
AbuseFilterCustomActions
AlternateEditPreview
AuthChangeFormFields
EditFilterMergedContent
EditPage::showEditForm:fields
EditPageBeforeEditButtons
EmailUser
EmailUserForm
MakeGlobalVariablesScript
PageSaveComplete
ResourceLoaderRegisterModules
TitleReadWhitelist
Licence
GNU General Public License 2.0 or later
Download extension
Git
Browse repository
GitHub
Gerrit code review
Git commit log
Download source tarball
Translate the ConfirmEdit extension
if it is available at translatewiki.net
Vagrant role
confirmedit
Issues
Open tasks
Report a bug
The
ConfirmEdit
extension lets you use various
CAPTCHA
techniques to try to prevent
spambots
and other automated tools from editing your wiki, as well as to foil automated login attempts that try to guess passwords.
ConfirmEdit ships with several techniques/modules to generate a captcha.
Module
Description
Effectiveness at stopping spam
SimpleCaptcha
Users have to solve a
simple
math problem.
Low
FancyCaptcha
Users have to identify a series of characters displayed in a stylized way.
Low
QuestyCaptcha
Users have to answer a question out of a series of questions defined by the administrator(s).
Very high, until cracked
ReCaptchaNoCaptcha
Users are presented with a JavaScript-based check of humanity. If the check is failed, a puzzle is presented.
Medium to low
hCaptcha
Similar to reCAPTCHA, but is arguably more effective than reCAPTCHA because of its
different approach to accessibility-friendly captchas
Low
Turnstile
Cloudflare
Turnstile
. Human actionless (or click the box) bot detector.
Proof of work
based.
Very high
Some of these modules require additional setup work:
FancyCaptcha requires running a preliminary setup script in Python.
Drawbacks
CAPTCHAs reduce accessibility and cause inconvenience to human users.
They also are not 100% effective against bots, and they will not protect your wiki from spammers who are willing and able to use human labor to get through the CAPTCHAs.
You may wish to use ConfirmEdit in conjunction with other
anti-spam features
Regardless of the solution you use, if you have a publicly-editable wiki, it's important to keep monitoring the "Recent changes" page.
Installation
This extension
comes with MediaWiki 1.18
and later, so you do not need to download it. The remaining configuration instructions must still be followed.
ConfirmEdit may not work if used with a MediaWiki version different from the one specified when downloading via the "Extension distributor".
and move the extracted
ConfirmEdit
folder to your
extensions/
directory.
Developers and code contributors should install the extension
from Git
instead, using:
cd
extensions/
git
clone
Add the following code at the bottom of your
LocalSettings.php
file:
wfLoadExtension
'ConfirmEdit'
);
Explicitly
enable the CAPTCHA type
(setting
$wgCaptchaClass
) which should be used
Configure
as needed
Done
– Navigate to
Special:Version
on your wiki to verify that the extension is successfully installed.
Vagrant installation:
If using
Vagrant
, install with
vagrant roles enable confirmedit --provision
CAPTCHA types
There are numerous different CAPTCHA types included with ConfirmEdit. Note that
MathCaptcha
was removed in 2024 (
change 1015991
).
QuestyCaptcha
This module presents a question, and the user supplies the answer.
You provide the questions in the configuration.
This module has proven to offer a strong mechanism against spambots; it should also have the advantage of better
, as textual questions can be read by text-to-speech software allowing visually impaired users (but not bots) to answer correctly.
Add the following to
LocalSettings.php
to enable this CAPTCHA, editing the Q&A:
wfLoadExtensions
([
'ConfirmEdit'
'ConfirmEdit/QuestyCaptcha'
]);
$wgCaptchaClass
'QuestyCaptcha'
// Add your questions in LocalSettings.php using this format:
$wgCaptchaQuestions
'What is the capital of France?'
=>
'Paris'
'What is the capital of Spain'
=>
'MADRID'
// Answers are case insensitive
'What is the name of this wiki?'
=>
$wgSitename
// You can use variables
'How many fingers does a hand have?'
=>
'five'
],
// A question may have many answers
];
It will randomly choose a question from those supplied.
The minimum is one.
QuestyCaptcha is case-insensitive. If the answer is "Paris" and the user writes "paris", or if the answer is "paris" and the user writes "Paris", it will still work.
If the answer has a special character like "ó", you may write an answer with "ó" and another with "o" (where "o" replaces "ó"), just in case. For example, if the answer is "canción" you can use
[ 'cancion', 'canción' ]
in case the user writes "cancion".
The answer must be easy to guess for a human interested in your wiki, but not by an automatic program. Ideally, it should not be contained in the text of the question; you can try and edit the captcha help messages and provide the solution to the captcha response there.
Change the questions when/if they start proving ineffective; this may never happen if your wiki is not specifically targeted.
Don't ever reuse questions already used by you or others in the past: spambots are known to remember a question and its answer forever once they break it.
You can even
dynamically generate questy captchas
in the configuration.
DO NOT
use an exact copy of the dynamic questions from the link. Spammers have cracked them. However, other dynamic questions are highly effective in the style of the questions presented.
There is a separate extension to ConfirmEdit called
QuestyCaptchaEditor
which provides an on-wiki special page for managing QuestyCaptcha question+answer(s) pairings. You may wish to consider installing it if it's desirable to reduce sysadmin intervention when it comes to managing the CAPTCHA questions and their answers.
ReCaptcha (NoCaptcha)
Warning:
ReCaptcha has been cracked by most spambots targeting wikis, mainly due to its accessible captcha alternative.
The new generation of ReCaptcha, called
NoCaptcha
, was introduced by Google back in December 2014 and reduces the need for humans to solve a CAPTCHA.
Based on a user-side JavaScript (which can't be
controlled
by the user, the administrator), reCaptcha tries to identify the site user as a human by analyzing their browsing behavior on the page.
The user then has to click an "I'm not a robot" checkbox and (in the best case) doesn't have to do anything further to prove they're a human.
In some cases, the user still has to solve a CAPTCHA image.
ReCaptcha will not work with the Mobile Source Editor and some extensions.
This module implements the new ReCaptcha NoCaptcha solution in ConfirmEdit.
You still need a public and a secret key (which you can retrieve from the
ReCaptcha admin panel
– change v2, v3 not work) and install the plugin with:
wfLoadExtensions
([
'ConfirmEdit'
'ConfirmEdit/ReCaptchaNoCaptcha'
]);
$wgCaptchaClass
'ReCaptchaNoCaptcha'
$wgReCaptchaSiteKey
'your public/site key here'
$wgReCaptchaSecretKey
'your private key here'
There is an additional configuration option for this module,
$wgReCaptchaSendRemoteIP
(default:
false
), which, if set to
true
, sends the IP address of the current user to a server from Google while verifying the CAPTCHA.
You can improve the privacy for your users if you keep this set to
false
However
, remember that this module adds a client-side JavaScript code, directly loaded from a server from Google, which already can collect the IP address of the user (combined with other data, too) and can
not
be limited by a configuration option.
This will only work on the standard MediaWiki editor.
reCAPTCHA v3
Currently, there is no official way to implement version 3 of Google reCAPTCHA.
SimpleCaptcha (calculation)
Warning:
This type is used by very few wikis, if any, probably because of scarce effectiveness.
A simple math question
This is the default CAPTCHA.
This module provides a simple addition or subtraction question for the user.
Add the following lines to
LocalSettings.php
in the root of your MediaWiki to enable this CAPTCHA:
wfLoadExtension
'ConfirmEdit'
);
$wgCaptchaClass
'SimpleCaptcha'
Note that the display of a trivial maths problem as plaintext yields a captcha which can be trivially solved by automated means; as of 2012, sites using SimpleCaptcha are receiving significant amounts of spam and many automated registrations of spurious new accounts.
Wikis currently using this as the default should therefore migrate to one of the other CAPTCHAs.
FancyCaptcha
Warning:
This type is used by very few wikis outside WMF, if any, probably because of scarce effectiveness.
This module displays a stylized image of a set of characters.
Pillow
must be installed to create the set of images initially, but isn't needed after that (can be installed with
pip install Pillow
in most environments).
Add the following lines to
LocalSettings.php
in the root of your MediaWiki installation:
wfLoadExtensions([ 'ConfirmEdit', 'ConfirmEdit/FancyCaptcha' ]);
$wgCaptchaClass = 'FancyCaptcha';
In
LocalSettings.php
, set the variable
$wgCaptchaDirectory
to the directory where you will store Captcha images.
Note:
use the absolute directory path or relative to your wiki's installation directory Below it set
$wgCaptchaSecret
to your passphrase.
Create the images by running the following:
python /path/to/captcha.py --font= --wordlist= --key= --output=