Adding / Removing account access features in MediaWiki
Written by James RichardsonMediaWiki by default allows any user to edit, create, and manage the Wiki site. Depending on what the Wiki is designed for, the administrator may want to restrict certain functions from the users. This Article will explain how to remove the create account link, restrict viewing and editing accounts, and page creation.
Note! Changing the values to False will disable the access and True will enable the access.
Account Access
How to remove the create account link?
The default account creation link at the top of the MediaWiki site can be disabled by editing the code in the LocalSettings.php file. This section will explain how to disable the Create account link at the top of the MediaWiki site.
- Log into cPanel
- Navigate to the Files > File Manager. Select click Go. Navigate to the MediaWiki location. An example of the location would be:
/home/userna5/public_html/mediawiki
Select the LocalSettings.php file and click code editor.
Add the following code to the file.
$wgGroupPermissions['*']['createaccount'] = false;
Click save
Now the Create account link will be completely removed from the page.
How do I restrict viewing, editing, and creating accounts?
MediaWiki by default has the wiki fully accessible to any user that is registered to the site. In the case that the Wiki needs to be made private, and restricted to System Operators (Sysop) only . Code can be added to the LocalSettings.php to disable these features. This will restrict the viewing, editing, and account creation portions of the MediaWiki site. The following will explain how disable the edit, viewing, and account creation sections in MediaWiki.
- Log into cPanel
- Navigate to the Files > File Manager. Select Go. Navigate to the MediaWiki location. An example of the location would be:
/home/userna5/public_html/mediawiki
- Select the LocalSettings.php file and click code editor.
- Add the following code to the file.
Allows access to .css, .js functions of the user login.
$wgWhitelistRead = array ("Special:Userlogin", "MediaWiki:Common.css", "MediaWiki:Common.js", "MediaWiki:Monobook.css", "MediaWiki:Monobook.js", "-");Disables the edit feature for anonymous users
$wgGroupPermissions['*']['edit'] = false;
Disables the account creation button.
$wgGroupPermissions['*']['createaccount'] = false;
Click Save. The anonymous user will no longer be able to view edit or create any thin on the wiki..
Restricting users editing capabilities
When setting up MediaWiki for the first time, all uses, whether anonymous or registered, can edit pages in the Wiki. The following section will explain how to restrict users from the editing capability.
- Log into cPanel
- Navigate to the Files > File Manager. Select Go. Navigate to the MediaWiki location. An example of the location would be:
/home/userna5/public_html/mediawiki
- Select the LocalSettings.php file and click code editor.
- Add the following code to the file.
Restricts Anonymous editing
$wgGroupPermissions['*']['edit'] = false;
Restricts User editing
$wgGroupPermissions['user']['edit'] = false;
Allows sysop (Systems Operator)
$wgGroupPermissions['sysop']['edit'] = True;
Click Save. Now only Sysops will be able to edit the site..
Preventing users from creating pages
Users can create and edit pages by default. you may want to restrict users from creating pages that do not apply to the wiki and at the same time give them editing access. The following steps will explain how to restrict page creation in MediaWiki.
- Log into cPanel
- Navigate to the Files > File Manager. Select Go. Navigate to the MediaWiki location. An example of the location would be:
/home/userna5/public_html/mediawiki
- Select the LocalSettings.php file and click code editor.
- Add the following code to the file.
Restricts Anonymous users from creating pages
$wgGroupPermissions['*']['createpage'] = false;
Restricts Users from creating pages
$wgGroupPermissions['user']['createpage'] = false;
Click Save. Anonymous and Users cannot create pages now.
Getting Started with MediaWiki
MediaWiki overview | |
| 1. | Basic MediaWiki site overview |
Installing MediaWiki | |
| 2. | Installing MediaWiki with Softaculous |
| 3. | Installing MediaWiki manually |
Manage Users and login | |
| 4. | How to log into MediaWiki |
| 5. | Managing passwords and usernames in MediaWiki |
| 6. | Managing User Accounts in MediaWiki |
| 7. | Adding / Removing account access features in MediaWiki |
Latest Questions
Need more Help?
Search
Ask the Community!
Current Customers
| Chat: | Click to Chat Now | E-mail: | support@InMotionHosting.com |
|---|---|---|---|
| Call: | 888-321-HOST (4678) | Ticket: | Submit a Support Ticket |

