How to Install the MediaWiki Visual Editor

Updated on October 17, 2022

Learn how to improve editing on your wiki by enabling the MediaWiki Visual Editor.

If you are using ProWiki MediaWiki Hosting, then you can easily enable or disable the Visual Editor via the wiki admin panel. It is enabled by default.

Editing options on the ProWiki admin panel

The below guide is for those who are using basic MediaWiki.

Visual Editor Explained

MediaWiki's Visual Editor is a tool that allows users to edit pages in a What-You-See-Is-What-You-Get (WYSIWYG) interface. It is designed to make editing pages more user-friendly, especially for users who are not familiar with wikitext.

When Visual Editor is installed and enabled, users can use it to edit pages by clicking their edit link.

A wiki page being edited with the MediaWiki Visual Editor

Visual Editor is one of the most popular MediaWiki extensions. It is used on Wikipedia and comes bundled with MediaWiki since version 1.35. See the user guide for and overview of available features and detailed usage instructions.

Enable Visual Editor

You will need to edit the LocalSettings.php configuration file. This is rather technical and requires server access.

This guide is for MediaWiki 1.35 and later.

  1. View the Special:Version page of your wiki, to ensure Visual Editor is not installed yet
  2. Start editing LocalSettings.php
  3. Add wfLoadExtension( 'VisualEditor' ); to the end of the file
  4. Save LocalSettings.php and reload your wiki. Visual Editor should now be listed on Special:Version

That's it! In modern MediaWiki installation of Visual Editor is a lot simpler than it used to be.

Apache and Subpages

If you are using the Apache webserver and use subpages on your wiki, then you need to add the following line to your top-level server configuration:

AllowEncodedSlashes NoDecode

Configure Visual Editor

Visual Editor comes with reasonable defaults. Even so, you might wish to tailor its behavior to suit your wiki and your own preferences.

You will need to edit the LocalSettings.php configuration file. This is rather technical and requires server access.

Choose Your Editing Tabs

To show only one editing tab that uses Visual Editor:

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

To show the Visual Editor tab and an Edit Source tab:

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

To show both editing tabs, but use Edit Source by default:

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

Disable Visual Editor Preferences

By default users can choose to disable visual editor for themselves via their user preferences. You can prevent them from doing that with:

$wgHiddenPrefs[] = 'visualeditor-enable';
$wgHiddenPrefs[] = 'visualeditor-betatempdisable';
$wgHiddenPrefs[] = 'visualeditor-tabs';

Visual Editor for Anonymous Users

This setting only makes sense if you have an open wiki that allows editing by people without an account.

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

Visual Editor Configuration Reference

See the complete list of configuration options.