Tech:Removing an extension
On this page
If a decision has been made to remove an extension from Miraheze—for example, because it is unmaintained, incompatible with the current MediaWiki version, or any other valid reason—the following procedure should be followed. Any user may submit a pull request to remove an extension, but only a Technology team member with appropriate access can merge and deploy the change.
The steps below must be followed in order:
- First, make sure the extension is temporarily restricted so that no new installs can occur during the removal process. To do this, follow the instructions at the Globally Disabling Extensions section.
- Run:
mwscript ManageWiki:ToggleExtension loginwiki --name=<extension> --disable --all-wikis --execute
- Remove any associated settings using:
mwscript ManageWiki:PopulateWikiSettings all --setting=<setting> --remove
- Delete any related configuration from the following files:
ManageWikiExtensions.php
LocalWiki.php
LocalSettings.php
GlobalSettings.php
- Note: If the extension also has entries in
ManageWikiSettings.php
orManageWikiNamespaces.php
, remove those as well. - Once configuration has been cleaned up, remove the extension from the
mediawiki-repos
GitHub repository.
On mwtask181
and test151
, also perform the following:
- Run:
sudo -u www-data rm -rf /srv/mediawiki-staging/*/{repo_path}
- Deploy updates with:
mwdeploy --world --config --pull=config --l10n --extension-list --servers=all --versions=all
Globally Disabling Extensions
If a full removal is not appropriate (e.g., in cases of temporary security concerns), an extension can be globally disabled without deleting user configuration by adding it to the
$wi::$disabledExtensions
array at the end of LocalSettings.php
.
This should follow the format:
'key from ManageWikiExtensions' => 'reason',
- The reason may be plain text or a wikitext link to a Phorge task (e.g.,
[[phorge:T12345]]
). - This disables the extension in
Special:ManageWiki/extensions
, requires themanagewiki-restricted
permission to modify it, and prevents the extension from being loaded.