From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manualManual:Extensions
Crystal Clear action run.png
External Articles

Release status:Extension status experimental

ImplementationTemplate:Extension#type Page action
DescriptionTemplate:Extension#description Loads article text from external wikis.
Author(s)Template:Extension#username Nathan Perry, Sam Wilson
Latest versionTemplate:Extension#version 0.1.4 (2013-05-31)
MediaWikiTemplate:Extension#mediawiki 1.17+
Database changesTemplate:Extension#needs-updatephp No
LicenseTemplate:Extension#license GNU General Public License 2.0 or later


Hooks usedTemplate:Extension#hook

Translate the ExternalArticles extension if it is available at translatewiki.net

Check usage and version matrix.

The ExternalArticles extension imports articles from external wikis. When you edit a page, the text of the same page on the external site is preloaded in the edit form.

This can save time when importing pages from an external website.


  • Download and place the file(s) in a directory called ExternalArticles in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php:
    require_once "$IP/extensions/ExternalArticles/ExternalArticles.php";
  • YesY Done - Navigate to Special:Version on your wiki to verify that the extension is successfully installed.


This step is optional. If you do not include the below code, this extension will use the defaults. If you define $eagRules, you must define all the elements of it (likely to change later so you can only override the settings you want).

This extension currently has only one configuration variable "$eagRules". If you wish to change the default behavior, put the following code in your LocalSettings.php above the require_once statement for this extension.

// External Articles Configuration
$eagRules = array();
// Specifies if text will be preloaded on edit
$eagRules['onpreload'] = true;
// Specifies the URL of the external wiki.  Must point to the index.php?title= and not the short link
$eagRules['url']       = 'http://en.wikipedia.org/w/index.php?title=';
// Specifies the regular expression used to determine if an article will be preloaded.
// See http://us3.php.net/manual/en/function.preg-match.php for more information.
#$eagRules['rule']      = '/.*/';           // All articles
$eagRules['rule']      = '/^Template:.*$/'; // Templates only (in English MediaWiki, default)
#$eagRules['rule']      = '/^.*talk:.*$/';  // Talk pages only (and any page that contains "talk:")


When a page is edited, its title must match the regular expression in $eagRules['rule']. If it matches, the content of the external article matching the current local page name is fetched and then preloaded into the local edit box. The extension will only preload when creating a new article, and when there is not already a local page being preloaded.

Known Issues[edit]

The default rule does not support languages other than English, as the namespace of a template is assumed to be "Template". When implementing in other languages the template namespace string is localized, so the rule must be updated to fit the current language.


We're looking for feedback on this extension. Security, performance, etc...

Please post feedback to the Extension_talk:ExternalArticles page.


This extension just fetches external wiki-text and inserts it into the edit box. No checking is done to validate or verify the wiki-text, and any edit is attributed to the user running.

Future development[edit]

The long term goal of this extension is to allow a wiki to use templates or other articles from external MediaWiki wikis without having to import the articles and all the transcluded articles it depends on manually. When an article is demanded (viewed, created, linked to, transcluded) it will be automatically downloaded from the external wiki and added to the local one.

There is no release schedule for this extension. When we have time and motivation to work on this extension, we will do so and make new releases that implement features when it makes sense to do so.

In May 2013, User:Samwilson adopted this extension, moved it into Gerrit, and is in the process of updating it.