Password protect a Mediawiki page.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Drake Panzer 88d4cac096 upload 9 months ago
i18n upload 9 months ago
src upload 9 months ago
LICENSE Initial commit 9 months ago upload 9 months ago
extension.json upload 9 months ago


Password protect a Mediawiki page

This is a very clumsy way to password protect a page, but it works and is kinda secure and convent.

Don't rely on this extension for important things or to keep data safe!

You need to lock down the API and role permissions to prevent users from viewing the page source. See my extension APILockdown.


  1. git clone

  2. mv mediawiki-page-password PasswordProtect

  3. Go to and generate two passwords (make sure to exclude Ambiguous Characters)

  4. Add to the bottom of LocalSettings.php:

    wfLoadExtension( 'PasswordProtect' );
    $wgPasswordProtectIV = "password 1";
    $wgPasswordProtectKey = "password 2";


To password protect a page, add this:

{{#Password: password1234|Content to render once authenticated}}

This will create a password field on the page this element is put on. When a user enters a password, they will be taken to pageName?action=password. If they entered the password right, the content will be shown.

You can put HTML in the second param. Just don't put it between <html></html> tags because that messes up Mediawiki the content rendering process.

This is only meant to work on article pages, not talk pages.


{{#Password: letmein|<h1>Welcome!</h1><br><p>hello how are you today?</p>}}

This creates a password letmein and a content render page which will display the HTML <h1>Welcome!</h1><br><p>hello how are you today?</p>.


You can style some elements in this extension:

passwordprotect-incorrect: the span element that displays Incorrect password.

passwordprotect-form: the password form element

passwordprotect-input: the password text input

passwordprotect-submit: the password form submit button