MediaWiki
Official CaptchaLa extension for MediaWiki. It is a driver for the ConfirmEdit extension, so it plugs into the same triggers as ConfirmEdit's built-in CAPTCHAs and is configured in LocalSettings.php.
Every widget is backed by a server-issued, single-use token, and each submission is checked on your server before MediaWiki saves anything.
What it covers
| Form | ConfirmEdit trigger | Action |
|---|---|---|
| Account creation (Special:CreateAccount) | createaccount | register |
| Page edits | edit | comment |
| Edits that add external links | addurl | comment |
| Email a user (Special:EmailUser) | sendemail | contact_form |
| Login after failed attempts (Special:UserLogin) | badlogin | login |
The first four are on by default ($wgCaptchalaTriggers). Login after failed attempts follows ConfirmEdit's own $wgCaptchaTriggers setting. Members of trusted groups are not challenged (see $wgCaptchalaSkipUserGroups). On the edit form the check is bound to Save changes; Show preview and Show changes are not challenged.
When a check fails, ConfirmEdit refuses the submission and shows its error on the form.
Requirements
- MediaWiki 1.43 or later
- ConfirmEdit 1.6 or later
- PHP 8.0+ and Composer
- A CaptchaLa account — get your App Key + App Secret at
dash.captcha.la
Install
Clone the GitHub repository into
extensions/Captchala(the folder name matters).Install the PHP SDK in that folder:
bashcd extensions/Captchala composer install --no-devLoad ConfirmEdit and Captchala in
LocalSettings.phpand add your keys:phpwfLoadExtension( 'ConfirmEdit' ); wfLoadExtension( 'Captchala' ); $wgCaptchalaAppKey = 'your-app-key'; $wgCaptchalaAppSecret = 'your-app-secret';
Captchala becomes the active ConfirmEdit driver when no other one is set. If LocalSettings.php already sets $wgCaptchaClass to another driver, point it at Captchala:
$wgCaptchaClass = 'MediaWiki\\Extension\\Captchala\\Captchala';Configure
All settings go in LocalSettings.php:
| Setting | Default | Description |
|---|---|---|
$wgCaptchalaAppKey | '' | Public key from the CaptchaLa dashboard. Required. |
$wgCaptchalaAppSecret | '' | Server secret, used to issue and validate tokens. Required; never sent to the browser. |
$wgCaptchalaProduct | 'bind' | bind (the check runs when the visitor presses the form's submit button), popup, float or embed (a verification bar inside the form). |
$wgCaptchalaLang | 'auto' | A BCP-47 tag such as ja or pt-BR, or auto to follow the visitor's browser. |
$wgCaptchalaTriggers | ['createaccount', 'edit', 'addurl', 'sendemail'] | The ConfirmEdit triggers CaptchaLa protects. |
$wgCaptchalaSkipUserGroups | ['sysop', 'autoconfirmed'] | Members of these groups are not challenged. |
Triggers that are on in ConfirmEdit's $wgCaptchaTriggers (such as badlogin) are protected as well. For example, to stop challenging every edit and keep the check only for edits that add links:
$wgCaptchalaTriggers = [ 'createaccount', 'addurl', 'sendemail' ];Until both keys are set, protected forms show a notice that CAPTCHA is not configured.
Screenshots


Notes
Privacy. The extension stores nothing in the wiki database.
Logs. Decisions are written to the
captchalalog channel. To collect them in a file:php$wgDebugLogGroups['captchala'] = "$IP/cache/captchala.log";
Troubleshooting
- The old CAPTCHA still appears. Another ConfirmEdit driver is set in
$wgCaptchaClass. Set it to Captchala as shown in Install. - Every submission is refused. Make sure the App Key and App Secret belong to the same app, and that your wiki's domain is allowed for that app in the dashboard.
- Trying it out. The public test keys let you check the full flow without an account.
Links
- Source and issues: github.com/Captcha-La/captchala-mediawiki
- Support: [email protected]