When setting up a MediaWiki site, you may want to allow visitors who are not registered or authenticated in your MediaWiki site to contact you for various reasons. An example of this is, if your MediaWiki site is only editable by a few people, you can have a contact page for visitors to email you if there are any website errors or misinformation on your site. This article will explain how to download, install, and configure the MediaWiki ContactPage extension.

Download the MediaWiki ContactPage extension

The ContactPage Extension is a free plugin you can get online at the WikiMedia code site. You can access it directly from the link below.

ContactPage Extension Download page.

If the link is not accessible, you can follow the steps below to get the ContactPage extension files. The version of this Extension changes frequently, so you can go directly to the WikiMedia code base to find a newer version. Below are the steps to obtain the files needed to install the MediaWiki ContactPage extension.

  1. Click browse code ContactPage MediaWikiGo to http://www.mediawiki.org/wiki/Extension:ContactPage and click the "browse code" link in the Download section.
  2. Click tree next to the version ContactPage MediaWikiAt the MediaWiki code review site, click "tree" next to the version right below below the "master" version.
  3. Click the raw link ContactPage MediaWikiYou will be directed to the "Code Review / mediawiki/extensions/ContactPage.git / tree" page.

    Click the "raw" link next to each file to download the PHP files to your local computer.

    Note! You do not need to download the .gitignore, .gitreview, README, and install.settings files as these are not needed.


    Save files to your computer ContactPage MediaWikiSave each PHP file to your computer.

    You should have the following files on your local computer.

    ContactPage.alias.php
    ContactPage.i18n.php
    ContactPage.php
    ContactPage_body.php 

Installing the MediaWiki ContactPage extension

Once you have downloaded all the necessary files for the ContactPage Extension to work, you will need to upload and configure the ContactPage extension. Below are the steps to upload and enable the ContactPage extension for MediaWiki.

  1. Login into your cPanel.
  2. Go to the File Manager. Select your MediaWiki installation directory and click Go.
  3. Navigate to your MediaWiki extensions folder. The path should look similar to the following.
    public_html/mediawiki/extensions

    Create a folder called "ContactPage" in the extensions folder.


  4. Directory of files ContactPage MediaWikiUpload your ContactPage extension php files to the extensions directory like so it looks like the snapshot to the right.

    Note! You do not need to upload the .gitignore, .gitreview, README, and install, settings files as these are not needed.


  5. Next, Navigate to the LocalSettings.php file in your MediaWiki root directory.

    Select the LocalSettings.php and edit it with the code editor.


  6. View of the code for ContactPage MediaWikiPlace the following code at the bottom of your LocalSettings.php file.
    require_once( "$IP/extensions/ContactPage/ContactPage.php" );
     
    $wgContactUser = 'Admin';
    $wgContactSender = $wgPasswordSender;
    $wgContactSenderName = 'Contact Form on ' . $wgSitename;

    Save the changes.


  7. Special pages in ContactPage MediaWikiNow Log into MediaWiki and click "Special" pages on the left hand side. On the "Special pages" page, the Contact page will be listed in the "Other special pages."

    No Email Error ContactPage MediaWikiImportant! If your email for the admin is not set up and authenticated, you will need to confirm the email address in your Admin user preferences. Otherwise you will get a "No e-mal address" error on the contact page. For more information on this please see our article on This user has not specified a valid e-mail address error: MediaWiki.

    View of the contact form ContactPage MediaWikiAs long as your email address is set up for your admin, you should see the contact form look like the snapshot to the right.


ContactPage Extension Configuration settings

The ContactPage Extension can have a few different configuration settings for customizing the form. Each setting can be added to your LocalSettings.php to enable or disable the setting. Below is a table with the available Configuration code settings.

MediaWiki ContactPage Extension Configuration
$wgUserEmailUseReplyTo Can be set to true of false. This will use the visitor's email address as the "Reply-To" address.

Syntax: $wgUserEmailUseReplyTo['contactpage'] = true;

$wgContactUser This is set to a string of Characters. This is the username of an account in your MediaWiki that has an enabled and authenticated email address. In this example we use the Admin users email address. The email must be configured in the users Preferences. For more information on how to configure the email in the user preferences, please see our article on This user has not specified a valid e-mail address error: MediaWiki.

Syntax: $wgContactUser = 'Your text goes here';

$wgContactSender Uses the email address of the $wgContactUser for the form submittal.

Syntax: $wgContactSender = $wgPasswordSender;

$wgContactSenderName This is set to a string of Characters. This will display the name in the email of the receiving email address.

Syntax: $wgContactSenderName = 'Your text goes here';

$wgContactRequireAll Can be set to true of false. If this is set to true, the contact form will require the fields in the form to be filled out. The default is False.

Syntax: $wgContactRequireAll['contactpage'] = true

$wgContactIncludeIP Can be set to true of false. Enables a checkbox in the contact form that allows the senders IP address to be included in the email.

Syntax:$wgContactIncludeIP['contactpage'] = true;

$wgCaptchaTriggers Enables the captcha in the contact form.

Important! This will not work unless reCAPTCHA is enabled. For information on enabling reCAPTCHA in MediaWiki, please see our article on How to enable reCAPTCHA in MediaWiki.

Syntax:$wgCaptchaTriggers['contactpage'] = true;

Did you find this article helpful?

We value your feedback!

Why was this article not helpful? (Check all that apply)
The article is too difficult or too technical to follow.
There is a step or detail missing from the instructions.
The information is incorrect or out-of-date.
It does not resolve the question/problem I have.
How did you find this article?
Please tell us how we can improve this article:
Email Address
Name

new! - Enter your name and email address above and we will post your feedback in the comments on this page!

Like this Article?

Related Questions

Here are a few questions related to this article that our customers have asked:
Ooops! It looks like there are no questions about this page.
Would you like to ask a question about this page? If so, click the button below!
Ask a Question

Post a Comment

Name:
Email Address:
Phone Number:
Comment:
Submit

Please note: Your name and comment will be displayed, but we will not show your email address.

0 Questions & Comments

Post a comment

Back to first comment | top

Need more Help?

Search

Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail: support@InMotionHosting.com
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!