How To Restrict Editing Of All But A Few Pages On MediaWiki?

A private MediaWiki website restricts editing of all pages whereas a traditional MediaWiki installation allows everyone to edit pages, even anonymous users. In this lesson you will learn about a special technique of proving edit right to users on selective pages.

You can disable editing of all pages, sitewide in your MediaWiki installation excluding a few pages such as sandboxes, join request pages, etc. The EditSubpages extension restricts editing of all but a few pages and their subpages by anonymous users on a MediaWiki website.

Sysops and other users from group with ‘editinterface’ permission may add pages to “MediaWiki:Unlockedpages” in-order to open them for anonymous editing.

The extension is quiet easy to setup, download its code then upload it to your extensions directory located in your site’s root and extract all files. Make sure all extracted files are placed in directory called EditSubpages in your extensions/ folder.

Then add the following code at the bottom of your LocalSettings.php:

require_once "$IP/extensions/EditSubpages/EditSubpages.php";

Now login to your MediaWiki website and in the search box type: ‘MediaWiki:Unlockedpages’ and press ENTER.

On this special page you simply need to specify i.e. type the names of pages to be unlocked in a bulleted list, they may be links.

Also note that any line you type which isn’t part of a bulleted list is taken as a comment.

For Example:

* Unlocked page 1
# Comment. Note that declaring the namespace matters
* Help:Unlocked page 2
* Talk:Unlocked page 3
 This is a comment too :). Unlike page 1, which has both the
 subject and talk page unlocked, page 3 only has an unlocked
 talk page.
* Unlocked page 4/subpage
# this will only unlock subpages of this subpage, so page 4 itself
# uneditable by anons.

This will allow anonymous users (or any user lacking the ‘edit’ permission) to edit given page and also its all subpages with their respective talk pages. There are more syntax parameters listed here, you can make use of them for defining your list of editable pages.

If you declare a talk page in the list, it will not make the respective subject page editable. To prevent talk pages from being edited but allow the subject pages to be, just protect the talk page.

Note that this will also allow anonymous users to create new pages that are sub-pages of the unlocked page on your MediaWiki installation.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.