How to require users to confirm their email address before being allowed to edit pages in MediaWiki

By default, users can edit and create pages on an open MediaWiki site without the need to authenticate their email addresses. Users can also register accounts and log into them and use them without being required to authenticate the email addresses that they provide; specifying an email address during registration is optional by default.

There are two separate options related to email authentication. One is a general option $wgEmailAuthentication with which (when enabled) registered users will be able to use the email function and options only after they authenticate their email address; if they don't do it they will still be able to use the other options and edit pages. For more information on that check out the article on how to enable and disable email authentication in MediaWiki.

The other email authentication option is related to page editing; it's disabled by default. If you enable it, this means that users will be allowed to edit pages only after they authenticate their email address. This also means that unregistered users will not be able to edit pages, and also that users will be required to provided an email address when creating an account (otherwise, it's optional). If you want to enable this option, put the following on a new line at the end of the LocalSettings.php file of your MediaWiki:

$wgEmailConfirmToEdit = true;

After you do this, when a user that hasn't confirmed their email address tries to edit a page, they will be shown its source content but they will not be allowed to edit it. There will be a message notifying them that in order to do it they have to authenticate their email address. When a user registers or changes their email address they receive an email message with a link for authenticating the address.

In case you want to disable the option again either delete the line or set it to false.

Note however than if the general option $wgEmailAuthentication is set to false and the user has provided an email address, then they will be able to edit content, regardless of whether that address is authenticated.

The LocalSettings.php file that you have to edit to enable and disable this option is located in the root MediaWiki folder on your MediaWiki hosting account. If the application is installed directly in the public_html directory on the account, then the path to the file will be public_html/LocalSettings.php. HostKnox customers can view and edit files on the account with the File manager of the Pixie control panel. Another way is to download the file on your local computer, edit it with a text editor (e.g. Notepad ++), then upload it back in the same folder.

When it comes to the email function and email authentication, you may also find useful the articles:

Was this answer helpful?

 Print this Article

Also Read