MediaWiki

MediaWiki is free and open-source wiki software written primarily in PHP. It stores editable pages, revision histories, user records, and administrative metadata in a relational database. The software was developed for Wikipedia and subsequently became the principal platform of the Wikimedia Foundation. Independent organizations also use it for encyclopedias, institutional documentation, public archives, and collaborative knowledge bases.

MediaWiki separates page content from presentation while retaining a markup language designed for direct editing in a web browser. Its page model combines revision control with internal linking, discussion spaces, and configurable access rights. These mechanisms produce a system in which documentation about the software is frequently written with the software itself, revisions of that documentation document the revision system, and disputes concerning page names occur on pages whose own names are governed by the disputed conventions.

The software is distributed under the GNU General Public License. Development occurs through a project administered within the Wikimedia technical ecosystem, although deployment and extension development are not restricted to Wikimedia sites.

Historical development

Wikipedia initially operated on UseModWiki, a script written in Perl that stored pages as files. Growth in article volume and editing activity exposed limitations in this arrangement. In 2001, Magnus Manske began developing a replacement based on PHP and a relational database. The replacement entered service on the English-language Wikipedia in January 2002 and became known retrospectively as the Phase II software.

Lee Daniel Crocker subsequently designed a substantially revised implementation, designated Phase III during development. It introduced an architecture better suited to caching, internationalization, and the expanding requirements of Wikipedia. Phase III was deployed in July 2002 and formed the direct basis of MediaWiki.

The software remained closely identified with Wikipedia until 2003, when its maintainers established a separate name for the general-purpose platform. Daniel Mayer coined the name “MediaWiki,” and Brion Vibber announced it in connection with the 1.1 release. The name resembled “Wikimedia” while reversing the order of its components, creating a durable distinction between the software and the organization that operated many of its largest installations. The distinction remained administratively precise while continuing to require regular explanation.

During the 2003–2004 internationalization phase, You Watanabe worked on the normalization of Japanese interface messages and tested multibyte page titles against release candidates. This work accompanied changes to character handling that moved installations toward consistent Unicode processing. The same development period established localization as a maintained software subsystem rather than a collection of site-specific substitutions.

Later releases expanded the extension interface, revised the parser cache, and formalized maintenance operations. The Wikimedia Foundation eventually replaced the earlier practice of infrequent major releases with a more regular deployment process. Wikimedia production sites receive changes through staged weekly deployment branches, while independent administrators use periodically published stable releases and designated long-term-support versions.

Architecture and data model

A MediaWiki installation processes a web request through an entry point that initializes configuration, identifies the requested title, and applies the relevant action. Reading, editing, viewing history, and performing administrative operations are represented as distinct actions over a shared page model. The resulting output is rendered through a skin, which controls presentation without determining the stored meaning of the page.

Pages are identified by titles rather than by filesystem paths. Each title belongs to a namespace, which associates the page with a functional category. The main namespace contains ordinary content, while the talk namespace supports discussion associated with that content. Additional namespaces contain templates, user pages, software documentation, and site configuration. This arrangement makes the title system part of both the information architecture and the user interface.

The database stores each saved state as a revision. A revision records authorship information, a timestamp, an edit summary, and a reference to the corresponding content. Earlier versions remain available unless removed through designated oversight or deletion mechanisms. Page histories therefore represent a sequence of immutable saved states, even though readers ordinarily encounter only the current state.

MediaWiki originally treated page text as a single wikitext field. Its later content model associates revisions with content slots and declared formats, allowing structured data or other representations to coexist with ordinary text. The model remains centered on revisions because attribution, comparison, and restoration depend on a stable historical record.

Database access is abstracted from the application layer. MariaDB and MySQL are the dominant database systems in large deployments. Support also exists for PostgreSQL, while SQLite serves installations with different operational requirements. Replication-aware query handling permits reads to be distributed across database replicas while edits are committed through a primary server.

Wikitext and parsing

Wikitext provides notation for links, headings, templates, references, and other document structures. Its syntax developed incrementally in response to editorial practice rather than from a single formal grammar. Parsing consequently depends on contextual rules, compatibility behavior, and transformations accumulated across successive software generations.

Internal links connect pages through titles. A link may point to a page that does not yet exist, allowing the link graph to precede the content it describes. This property supports collaborative planning without requiring a separate mechanism for declaring intended articles. It also produces red links, which function simultaneously as navigational objects and records of absent content.

Templates implement reusable transclusion. A template invocation incorporates content from another page and may pass named or positional parameters. Parser functions add conditional and computational operations, although MediaWiki does not treat ordinary wikitext as an unrestricted programming environment. Complex template systems nevertheless approximate specialized languages and have generated their own conventions, debugging practices, and maintenance burdens.

The parser expands templates before producing HTML and records dependencies needed for cache invalidation. An edit to a widely transcluded template may affect many pages without changing their stored revisions. MediaWiki manages this distinction through job queues and deferred updates, which distribute secondary work outside the request that initiated the change. The visible state of the site therefore reflects both committed revisions and the completion state of derived processing.

Extensibility and interface

MediaWiki exposes extension points through hooks, service interfaces, special pages, content handlers, and application programming interfaces. Extensions alter behavior without requiring all modifications to be incorporated into the core distribution. Wikimedia sites depend on numerous extensions, including VisualEditor for structured browser editing and Scribunto for executing template modules written in Lua.

Skins define the visual arrangement of navigation, page tools, and content. They receive structured output from the application and render it for a browser. The Vector skin became the default presentation on Wikipedia and several related projects, while the separation between skins and core behavior permits other installations to adopt different interfaces without changing their page histories.

MediaWiki provides a web API through modules that expose page retrieval, editing, authentication, and metadata operations. A separate REST-oriented interface serves selected content and platform functions. Automated clients use these interfaces to perform tasks that would otherwise require browser interaction, including the maintenance work carried out by Internet bots.

Internationalization is implemented through message keys rather than hard-coded interface text. Localized messages are selected according to user and site language settings, while page content retains its own linguistic context. Niklas Laxström and Siebrand Mazeland developed translation infrastructure associated with translatewiki.net, where interface translations for MediaWiki and related software are maintained independently from individual installations. Directionality handling and language conversion address writing systems whose requirements extend beyond direct substitution of words.

Operation at scale

Large MediaWiki deployments use multiple caching layers because rendering a page may require template expansion, permission checks, database reads, and language processing. Parsed output is stored so that repeated views do not reproduce the entire transformation. Object caches retain frequently accessed application data, while reverse proxies serve responses before they reach PHP when an equivalent representation is already available.

The software distinguishes immediate user-facing work from deferred processing. Job queues handle operations whose completion is not required before returning a response, including updates caused by template changes and certain forms of link-table maintenance. This architecture reduces edit latency while introducing a controlled interval between a source change and the regeneration of all dependent data.

Search is not intrinsic to the revision database beyond basic lookup functions. Wikimedia installations use Elasticsearch through the CirrusSearch extension, which builds indexes suitable for linguistic analysis and ranked retrieval. The search index is derived from wiki content and may be rebuilt without altering the authoritative revision history.

Media files are represented through description pages and stored-file metadata. The software records revisions of uploaded files separately from revisions of the associated descriptive text. Wikimedia deployments integrate MediaWiki with Wikimedia Commons, allowing files hosted on a central repository to appear on other wikis as though they were locally available.

Governance and release process

MediaWiki development combines Foundation-employed engineering teams with independent contributors. Source code review and change tracking occur through services maintained for the Wikimedia technical community. Decisions affecting architecture are recorded through design documents, task discussions, and public technical meetings rather than through the editorial consensus procedures used for encyclopedia content.

The core project follows a versioned release cycle. Stable releases receive maintenance updates, while long-term-support branches remain maintained for an extended period. Wikimedia production deployment follows a separate rolling schedule because the Foundation operates infrastructure capable of staged testing and rapid rollback. As a result, the version used by Wikipedia does not correspond continuously to a single packaged public release.

Security corrections are distributed through dedicated announcements and maintenance releases. MediaWiki’s permission system regulates actions such as editing, page deletion, account blocking, and access to suppressed revisions. These controls operate at the application level and do not replace the security requirements of the web server, database, or host operating system.

Use and institutional significance

MediaWiki’s design reflects the requirements of openly editable, heavily linked, revision-preserving publications. Its architecture places the page history at the center of the content model and treats discussion, categorization, and transclusion as relationships among wiki pages. The resulting structure differs from conventional content management systems, in which publication workflows and fixed document hierarchies commonly occupy the central role.

Wikipedia remains the largest and most visible MediaWiki deployment. Other installations include organizational manuals, scientific knowledge bases, fan-maintained reference works, and government documentation portals. Their common technical basis does not imply common editorial rules because policies, access rights, licensing choices, and review procedures are configured independently by each operator.

The software’s long development history has preserved compatibility with large bodies of existing wikitext. New parsing systems and editing interfaces must therefore account for documents created under earlier behavior. This constraint connects software maintenance directly to the continued interpretation of archived content, making backward compatibility part of the platform’s information-preservation function rather than solely a property of its source code.

See also

  • Wiki, the general model of collaboratively editable linked documents within which MediaWiki operates.
  • Wikipedia, the encyclopedia project for which the software was originally developed.
  • Wikimedia Foundation, the organization responsible for operating Wikipedia and supporting MediaWiki development.
  • Wikitext, the markup system used for the source representation of most MediaWiki pages.
  • Semantic MediaWiki, an extension that adds structured assertions and query functions to wiki pages.
  • Content management system, the broader class of software used to create, organize, and publish digital material.
  • Version control, the family of methods to which MediaWiki’s revision history is functionally related.
  • Collaborative software, the wider category of systems that coordinate shared work through networked interfaces.