Disable Anonymous Editing in MediaWiki
If you want to disable Anonymous editing in MediaWiki, here is one way to do it:
- Edit
LocalSettings.phpand add the following setting:
$wgDisableAnonEdit = true;
- Edit
includes/SkinTemplate.php, find$fname-editand change the code to look like this (i.e., basically wrap the following code between thewfProfileIn()andwfProfileOut()functions):
wfProfileIn( "$fname-edit" );
global $wgDisableAnonEdit;
if ( $wgUser->mId || !$wgDisableAnonEdit) {
// Leave this as is
}
wfProfileOut( "$fname-edit" );
Next, you may want to disable the [Edit] links on sections. To do this, open includes/Skin.php and search for editsection. You will see something like:
if (!$wgUser->getOption( 'editsection' ) ) {
Change that to:
global $wgDisableAnonEdit;
if (!$wgUser->getOption( 'editsection' ) || !$wgDisableAnonEdit ) {
Section editing is now blocked for Anonymous users.


This is a better solution:
By adding the following line to LocalSettings.php, it is possible to entirely disable anonymous edits:
Pre-1.5:
$wgWhitelistEdit = true;
Note that you have to add this to the end of the LocalSettings.php file, just above the closing “?>” for it to work properly.
1.5 upwards:
$wgGroupPermissions[’*’][‘edit’] = false;
From http://meta.wikimedia.org/wiki/Preventing_Access#Disable_anonymous_edits
Thanks, just one thing: please be care about the quotation marks. They look similar but are different
$wgGroupPermissions[’*’][‘edit’] = false;
$wgGroupPermissions[’*’][‘edit’] = false;
Thanks for the tip, it worked like a charm