How to Install VisualEditor in MediaWiki

By XaHertz  |  January 16, 2025  |  Last Updated : January 16, 2025

VisualEditor is a user-friendly extension for MediaWiki, designed to simplify content editing by providing a WYSIWYG (What-You-See-Is-What-You-Get) interface. This article walks you through the installation and configuration process of VisualEditor step-by-step to ensure seamless integration.

Step 1: Verify Version Compatibility

Before proceeding, confirm that your MediaWiki version is 1.35 or higher. Versions 1.35 and above come with VisualEditor bundled, making the installation process more straightforward. If your version is outdated, back up your current wiki database and files and Upgrade to a compatible version by following the official MediaWiki upgrade guide.

Step 2: Enable the VisualEditor Extension

Navigate to the directory where your MediaWiki installation resides. Locate the LocalSettings.php file in the root directory. Append the following line at the bottom of your LocalSettings.php file:

wfLoadExtension( 'VisualEditor' );

This enables VisualEditor in your MediaWiki installation. Ensure the file is saved after editing, and verify that the syntax is error-free.

Step 3: Configure VisualEditor (Optional but Recommended)

Fine-tune VisualEditor settings for a customized experience. These optional configurations allow for enhanced functionality and a smoother editing process.

1. Enable VisualEditor by Default for All Users

To ensure all users, including new accounts, have VisualEditor enabled by default, add:

$wgDefaultUserOptions['visualeditor-enable'] = 1;
$wgHiddenPrefs[] = 'visualeditor-enable';

This prevents users from disabling VisualEditor.

2. Enable Wikitext mode by Default for All Users

The 2017 wikitext editor is a feature within the VisualEditor extension that allows users to edit wikitext source code using VisualEditor's tools and toolbar. To ensure all users, including new accounts, have Wikitext mode enabled by default, add:

$wgVisualEditorEnableWikitext = true;
$wgDefaultUserOptions['visualeditor-newwikitext'] = 1;
$wgHiddenPrefs[] = 'visualeditor-newwikitext';

This also prevents users from disabling the Wikitext mode.

3. Use a Single Edit Tab for a Simplified Interface

To combine the "Edit" and "Edit Source" tabs into a single tab that defaults to VisualEditor, add:

$wgVisualEditorUseSingleEditTab = true;
$wgDefaultUserOptions['visualeditor-editor'] = 'visualeditor';
$wgDefaultUserOptions['visualeditor-tabs'] = 'prefer-ve';

4. Default Editor for Anonymous Users

If your wiki allows edits from anonymous users and you want VisualEditor as their default editor, add:

$wgDefaultUserOptions['visualeditor-editor'] = 'visualeditor';

For a complete list of configuration options and examples, visit the VisualEditor extension page.

Step 4: Verify Installation

Navigate to your wiki and open the Special:Version page. Check the list of installed extensions. If VisualEditor is listed, the installation is successful.

Step 5: Test VisualEditor

Open any page on your wiki. Click the "Edit" or "Edit Source" tab to test if VisualEditor is functioning. Confirm that VisualEditor is the default editor (if configured).

Final Thoughts

With the VisualEditor extension installed and configured, your MediaWiki now offers an intuitive WYSIWYG interface, enhancing usability for editors of all skill levels. Whether you’re managing a small community or a large-scale wiki, VisualEditor streamlines content creation and reduces the learning curve for contributors.


Last updated on January 16, 2025