Skip to content

25 Extension Installation

DodaTech 9 min read

title: "MediaWiki Extension Installation & Management — Extension Registry, Versioning, and Updates" description: "Install and manage MediaWiki extensions: extension registry, version compatibility, dependency management, updating extensions, and best practices for extension lifecycle." weight: 25 date: 2026-06-26 lastmod: 2026-06-26 tags: [cms, mediawiki] }

Extension installation and management in MediaWiki follows a structured process of downloading, enabling with wfLoadExtension, checking version compatibility, managing dependencies, and performing updates — the same workflow Wikipedia uses to maintain its ecosystem of hundreds of extensions.

What You'll Learn

  • Finding extensions on the MediaWiki extension registry
  • Installing extensions with version compatibility checks
  • Managing extension dependencies
  • Enabling and configuring extensions
  • Updating extensions safely
  • Troubleshooting extension issues

Why It Matters

Extensions are how you add features to MediaWiki. But installing them incorrectly can break your wiki. An extension designed for a different MediaWiki version may cause errors. Two extensions may conflict with each other. An outdated extension may create a security vulnerability. Understanding the extension lifecycle — from finding and installing to updating and removing — keeps your wiki stable, secure, and functional.

Real-World Use

A DodaTech wiki needs a new feature: embedding videos in documentation pages. The admin finds the EmbedVideo extension on the MediaWiki extension registry, checks that it supports version 1.42, downloads it, tests it on a staging wiki, enables it in LocalSettings.php, and deploys it to production. Six months later, when upgrading MediaWiki to 1.44, the admin checks that EmbedVideo has a compatible version and updates it.

Learning Path

flowchart LR
  A["23: Bots & Automation"] --> B["24: User Preferences"]
  B --> C["25: Extension Installation"]
  C:::current
  D["26: Semantic MediaWiki"]
  E["27: VisualEditor"]
  F["28: Scribunto & Lua"]

  C --> D --> E --> F

  classDef current fill#38bdf8,color#0f172a,stroke-width:2px

The Extension Registry

The official source for extensions is the MediaWiki Extension Registry.

Finding Extensions

The registry lists over 2,500 extensions. Search by:

  • Keyword: "captcha," "editor," "search"
  • Category: "Editing," "Security," "Media"
  • Compatibility: Filter by MediaWiki version
  • Popularity: Most downloaded or most used

Extension Page Structure

Each extension has a page on mediawiki.org with:

  • Description: What the extension does
  • Compatibility: Which MediaWiki versions are supported
  • Dependencies: Other extensions or software required
  • Configuration: LocalSettings.php settings
  • Usage: Examples and documentation
  • Changelog: Version history with release notes

Step 1: Check Version Compatibility

Before installing any extension, verify it works with your MediaWiki version.

Check Your MediaWiki Version

Go to Special:Version on your wiki. The top of the page shows:

MediaWiki: 1.42.2

Alternatively, check the includes/VersionConstants.php file:

const MW_MAJOR_VERSION = '1.42';
const MW_VERSION = '1.42.2';

Match Extension Version

The extension distributor shows which extension version works with each MediaWiki version:

Extension: VisualEditor
  REL1_42 — Works with MediaWiki 1.42
  REL1_41 — Works with MediaWiki 1.41
  master — Development version (may be unstable)

Always download the branch matching your MediaWiki version. Using the wrong version is the most common cause of extension failures.

Step 2: Download an Extension

Method 1: Extension Distributor

  1. Go to https://www.mediawiki.org/wiki/Special:ExtensionDistributor
  2. Select the extension name
  3. Select your MediaWiki version
  4. Download the tar.gz file
  5. Extract into your wiki's extensions/ directory
cd /opt/lampp/htdocs/mediawiki/extensions
wget https://extdist.wmflabs.org/dist/extensions/EmbedVideo-REL1_42-abc123.tar.gz
tar -xzf EmbedVideo-*.tar.gz

Method 2: Git Clone

cd /opt/lampp/htdocs/mediawiki/extensions
git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/EmbedVideo.git
cd EmbedVideo
git checkout REL1_42

Git gives you easier updates (just git pull on the branch), but requires Git to be installed.

Method 3: Composer

Some extensions are available via Composer:

cd /opt/lampp/htdocs/mediawiki
composer require mediawiki/semantic-media-wiki "^4.0"

Composer handles dependencies automatically, which is a major advantage for complex extensions.

Step 3: Enable the Extension

All modern extensions use the wfLoadExtension function:

wfLoadExtension( 'EmbedVideo' );

Older Extensions

Extensions that have not been updated may still use the old require_once syntax:

require_once "$IP/extensions/EmbedVideo/EmbedVideo.php";

Check the extension's documentation. If it mentions wfLoadExtension, use that. If not, use require_once.

Order Matters

If an extension depends on another, load the dependency first:

wfLoadExtension( 'Dependency' );
wfLoadExtension( 'MainExtension' );

Load order is specified in the extension documentation.

Step 4: Configure the Extension

Most extensions have configuration settings that go in LocalSettings.php after the wfLoadExtension line:

wfLoadExtension( 'EmbedVideo' );

// Configuration settings
$wgEmbedVideoDefaultWidth = 640;
$wgEmbedVideoEnabledServices = [ 'youtube', 'vimeo', 'dailymotion' ];

Configuration settings are documented on the extension's mediawiki.org page. They are prefixed with the extension name (e.g., $wgEmbedVideoDefaultWidth).

Required Configuration

Some extensions require mandatory configuration:

wfLoadExtension( 'ConfirmEdit' );

// Required: Choose a CAPTCHA module
$wgCaptchaClass = 'Captcha\SimpleCaptcha\SimpleCaptcha';

Without required configuration, the extension may not work or may cause errors.

Step 5: Verify the Installation

Check Special:Version

Go to Special:Version after enabling. Your extension should appear in the "Installed extensions" section with its version number.

Test the Functionality

If the extension adds a parser function, test it on a sandbox page:

{{#ev:youtube|VIDEO_ID}}

If the extension adds a special page, navigate to it:

Special:MyExtension

Check for Errors

Watch for these signs of problems:

  • White screen: PHP fatal error — check error logs
  • PHP warnings: Displayed at the top of pages
  • "This extension requires...": Missing dependencies
  • Parser function not working: Extension not registered correctly

Step 6: Managing Dependencies

Some extensions require other extensions or software.

Extension Dependencies

The extension's extension.json specifies dependencies:

{
    "requires": {
        "MediaWiki": ">= 1.42",
        "extensions": {
            "ParserFunctions": "*"
        }
    }
}

If a dependency is missing, MediaWiki displays an error when you try to enable the extension.

Software Dependencies

  • Lua: Scribunto extension requires Lua binaries
  • ImageMagick: Many image-related extensions require ImageMagick
  • Elasticsearch: CirrusSearch extension requires Elasticsearch server
  • Redis: Some caching extensions require Redis

PHP Extensions

Some extensions require PHP extensions:

# Example: The Intl extension for certain date formatting
sudo apt install php-intl

Check the extension documentation for PHP requirements.

Step 7: Updating Extensions

Check for Updates

Monitor Special:Version for extension versions. Extension developers release updates for:

  • Security patches
  • Bug fixes
  • Compatibility with new MediaWiki versions
  • New features

Update Process

  1. Backup your wiki database and files
  2. Disable the extension by commenting out wfLoadExtension
  3. Download the new version
  4. Check the changelog for breaking changes
  5. Update configuration if needed
  6. Enable the new version
  7. Test thoroughly on a staging wiki first

Composer Updates

For Composer-managed extensions:

cd /opt/lampp/htdocs/mediawiki
composer update vendor/extension-name

Update Frequency

  • Security patches: Apply immediately
  • Bug fixes: Apply within a week
  • Feature releases: Evaluate before updating
  • Major version changes: Plan carefully, check for breaking changes

Step 8: Removing Extensions

To safely remove an extension:

  1. Remove the wfLoadExtension line from LocalSettings.php
  2. Delete the extension directory from extensions/
  3. Run php maintenance/update.php if the extension added database tables
  4. Check for orphaned configuration settings

Extensions that add database tables leave those tables behind when removed. Run the maintenance script to clean up if needed.

What You Learned

  • The extension registry at mediawiki.org lists 2,500+ extensions
  • Version compatibility is critical — match extension to MediaWiki version
  • Download methods: extension distributor, Git clone, Composer
  • Enable with wfLoadExtension('Name') in LocalSettings.php
  • Configure with $wgExtensionNameSettings variables
  • Dependencies must be installed and loaded in the correct order
  • Updates require backup, testing, and changelog review
  • Removal involves disabling, deleting, and potentially running maintenance scripts

In the next lesson, you'll learn about Semantic MediaWiki — adding structured data to your wiki.

Common Mistakes

Mistake Why It Happens How to Fix
White screen after enabling extension PHP syntax error or version mismatch Check PHP error logs. Verify the extension version matches your MediaWiki version. Temporarily remove the wfLoadExtension line to recover.
Extension not appearing in Special:Version wfLoadExtension syntax incorrect Check the spelling of the extension name in wfLoadExtension. It must match the extension directory name exactly. Verify the extension directory exists.
"Cannot find extension.json" error Extension files in wrong location The extension directory must contain extension.json directly. Check that you did not create a subdirectory: extensions/Name/extension.json (correct) vs extensions/Name/Name/extension.json (wrong).
Two extensions conflicting with each other Both modify the same hook Disable one extension to identify the conflict. Check both extensions' documentation for known conflicts. Consider alternatives to the conflicting extensions.
Extension works on staging but not production Different MediaWiki versions or different PHP settings Ensure staging and production have identical PHP versions, MediaWiki versions, and installed PHP extensions. Check for environment-specific configuration differences.

Practice Questions

  1. What three pieces of information do you need before installing an extension?
  2. How do you check which MediaWiki version your wiki is running?
  3. What is the difference between wfLoadExtension and require_once for loading extensions?
  4. Challenge: Build an extension management workflow. Install three extensions on your wiki: EmbedVideo, PageForms, and CodeEditor. Document the installation steps for each, including any dependencies. Create a spreadsheet or wiki page called "Extension Inventory" with columns: Extension Name, Version, MediaWiki Compatibility, Dependencies, Configuration Settings, Last Updated. For each extension, verify it appears on Special:Version and test its core functionality. Simulate an update by downloading a newer version of one extension and updating it. Finally, remove one extension completely and verify the wiki works without it.

FAQ

How do I find extensions that are compatible with my MediaWiki version?

Use the Extension Distributor at mediawiki.org. Select your MediaWiki version and browse compatible extensions. Alternatively, check the extension's mediawiki.org page — the infobox shows which versions are supported.

Can I install two extensions that do similar things?

Yes, but they may conflict if they modify the same hooks. Test them together on a staging wiki first. If they conflict, you may need to choose one or find an extension that combines both features.

What happens to extension data when I uninstall?

Extension data in the database remains unless you run maintenance scripts to remove it. Extension configuration in LocalSettings.php must be manually removed. Page content created by the extension remains but may display raw code instead of rendered output.

How do I know if an extension is secure?

Check the extension's mediawiki.org page for security advisories. Extensions maintained by the Wikimedia Foundation are generally well-audited. Avoid extensions that have not been updated in over a year.

Do I need to update extensions when I upgrade MediaWiki?

Yes. Always update extensions when upgrading MediaWiki. Run Special:Version after the upgrade and check that all extensions show compatible versions. Update any that show unknown or incompatible versions.

Mini Project

Goal: Build and manage an extension ecosystem for a production wiki.

  1. Create a staging wiki (copy of your production wiki)
  2. Research and select 5 extensions for your wiki (e.g., EmbedVideo, PageForms, CodeEditor, ConfirmEdit, and one of your choice)
  3. Create a checklist for extension installation:
    • Check MediaWiki version compatibility
    • Check dependencies
    • Download and extract
    • Enable in LocalSettings.php
    • Configure settings
    • Test on staging
    • Update Special:Version
  4. Install all 5 extensions on the staging wiki
  5. Document the configuration for each extension
  6. Test that all 5 work together without conflicts
  7. Create a backup before installing on production
  8. Deploy to production
  9. Set up a monthly calendar reminder to check for extension updates

What's Next

Now that you can install any extension, let's explore Semantic MediaWiki — one of the most powerful extensions available.

Continue to Lesson 26: Semantic MediaWiki — learn how to add structured data, properties, and inline queries to your wiki.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro