To prevent spam bots and robots from filling your MediaWiki pages with spam links and unwanted content, you can have the "reCAPTCHA" enabled in your MediaWiki LocalSettings.php to prevent bots from editing your pages. ReCAPTCHA is a free service from Google that allows you to add a verification box to determine if the page is being edited by a human or not. ReCAPTCHA uses a public and private key to create different words required for the image. Form pre information on reCAPTCHA please see our article on How to get the public and private keys for Google reCAPTCHA.

Adding reCAPTCHA to your WIKI edit sections

  1. Login into your cPanel.
  2. Go to the File Manager. Select your MediaWiki installation directory and click Go.
  3. Find the LocaSettings.php file and open it with the code editor.
  4. Code view of reCAPTCHA code MediaWikiAdd the following lines at the end of your LocalSettings.php file.
    require_once("$IP/extensions/ConfirmEdit/ReCaptcha.php"); 
    $wgCaptchaClass = ReCaptcha;
    $wgReCaptchaPublicKey = 'Your captcha public key';
    $wgReCaptchaPrivateKey = 'Your captcha private key';

    This code will link your Edit pages to the reCAPTCHA in your ConfirmEdit file.

    Add the following code below the reCAPTCHA code. This code gives permission to users where they get the captcha or not. Also, it enables the reCAPTCHA for specific features. In this case the edit, create, createaccount, and contactpage all will have the reCAPTCHA on it.

    $wgGroupPermissions['*'            ]['skipcaptcha'] = false;
    $wgGroupPermissions['user'         ]['skipcaptcha'] = true;
    $wgGroupPermissions['autoconfirmed']['skipcaptcha'] = true;
    $wgGroupPermissions['bot'          ]['skipcaptcha'] = true; // registered bots
    $wgGroupPermissions['sysop'        ]['skipcaptcha'] = true;
     
    $wgCaptchaTriggers['edit']          = true;
    $wgCaptchaTriggers['create']        = true;
    $wgCaptchaTriggers['createaccount'] = true;
    $wgCaptchaTriggers['contactpage'] = true; // Adds reCAPTCHA to the contact page if created

    Save the changes.


    Preview of the reCAPTCHA in MediaWikiNow when someone that is not logged into your MediaWiki site tries to submit a change to your pages, the reCAPTCHA will display like the image to the right.

    Important! When editing pages in your MediaWiki, the reCAPTCHA will not display until you click the save button. After you click the save button, the reCAPTCHA will appear at the top with a warning.


     

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 our Support Center:
Email Address
Optional, but our team may contact you for more information.
Like this Article?

Post a Comment

Name:
Email Address:
Comment:
Are you a bot?
Submit

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

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

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!