--- title: MediaWiki description: Install the CaptchaLa MediaWiki extension, a ConfirmEdit driver that protects account creation, page edits, new external links, Special:EmailUser and login retries. --- # MediaWiki Official CaptchaLa extension for MediaWiki. It is a driver for the [ConfirmEdit](https://www.mediawiki.org/wiki/Extension: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](https://www.mediawiki.org/wiki/Extension:ConfirmEdit) 1.6 or later - PHP 8.0+ and Composer - A CaptchaLa account — get your **App Key** + **App Secret** at [`dash.captcha.la`](https://dash.captcha.la) ## Install 1. Clone the [GitHub repository](https://github.com/Captcha-La/captchala-mediawiki) into `extensions/Captchala` (the folder name matters). 2. Install the PHP SDK in that folder: ```bash cd extensions/Captchala composer install --no-dev ``` 3. Load ConfirmEdit and Captchala in `LocalSettings.php` and add your keys: ```php wfLoadExtension( '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: ```php $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: ```php $wgCaptchalaTriggers = [ 'createaccount', 'addurl', 'sendemail' ]; ``` Until both keys are set, protected forms show a notice that CAPTCHA is not configured. ## Screenshots ![MediaWiki account creation form with the CaptchaLa security check above Create your account](/images/plugins/mediawiki/createaccount-form.webp) ![MediaWiki edit form with the CaptchaLa security check above Save changes](/images/plugins/mediawiki/edit-form.webp) ## Notes - **Privacy.** The extension stores nothing in the wiki database. - **Logs.** Decisions are written to the `captchala` log 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](#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](/testing) let you check the full flow without an account. ## Links - Source and issues: [github.com/Captcha-La/captchala-mediawiki](https://github.com/Captcha-La/captchala-mediawiki) - Support: [supply@captcha.la](mailto:supply@captcha.la)