Skip to content
MediaWiki Guide — The Wiki Engine Behind Wikipedia

MediaWiki Guide — The Wiki Engine Behind Wikipedia

DodaTech Updated Jun 6, 2026 5 min read

MediaWiki is the wiki engine that runs Wikipedia — one of the most visited websites in the world. Think of it as a living encyclopedia: anyone can create and edit pages, and every change is tracked forever. If WordPress is for blogging and Drupal is for enterprise content, MediaWiki is for collaborative knowledge building.

What You’ll Learn

  • MediaWiki’s wiki-based content model and page history
  • Writing and formatting pages with wiki markup
  • Templates, categories, and namespaces
  • Extensions and skin customization
  • User permissions and anti-spam measures

Why Wiki-Based CMS Matters

Traditional CMS platforms have one author (or a small team) creating content for readers. MediaWiki inverts this: every reader can be an author. Changes are tracked, reviewed, and reversible. This model powers Wikipedia, but also internal company wikis, documentation sites, and knowledge bases.

DodaTech uses wiki-style documentation internally — every team member can update technical specs, and changes are tracked with full history, similar to how Durga Antivirus Pro maintains its threat documentation.

    flowchart LR
    A["CMS Overview"] --> B["MediaWiki<br/><strong>You are here</strong>"]:::current
    B --> C["Choose Your CMS"]

    classDef current fill:#38bdf8,color:#0f172a,stroke-width:2px;
  
Prerequisites: Basic understanding of web servers (Apache or Nginx), PHP, and MySQL. No wiki experience needed.

Installation

MediaWiki requires a web server with PHP and a database (MySQL or MariaDB):

# Download the latest version
wget https://releases.wikimedia.org/mediawiki/1.42/mediawiki-1.42.1.tar.gz
tar -xvzf mediawiki-1.42.1.tar.gz
mv mediawiki-1.42.1 /var/www/html/wiki

# Point your browser to https://yourserver/wiki/
# Follow the web installer — it creates the database tables
# and generates a LocalSettings.php configuration file

After installation, protect LocalSettings.php — it contains your database password:

chmod 600 /var/www/html/wiki/LocalSettings.php

Page Structure

MediaWiki stores content in a database, not files. Each page has a title (used in the URL) and wikitext content:

https://yourserver/wiki/index.php/Page_Title

Every page has a history tab showing all revisions:

== Section Heading ==
This is a paragraph with '''bold text''' and ''italic text''.

* Bullet list item
* Another item

# Numbered list item
## Nested item

=== Linking Between Pages ===

[[Page Title]]              # Link to another wiki page
[[Page Title|display text]]  # Link with custom label
[[Category:Tutorials]]       # Add page to a category

Templates

Templates are reusable wiki snippets stored in the Template: namespace:

{{Infobox software
  | name        = MyApp
  | developer   = DodaTech
  | latest      = 2.0
  | license     = MIT
}}

Call a template with {{TemplateName|param=value}}. Templates can include conditional logic and default parameter values, making them powerful for consistent page layouts.

Namespaces

Namespaces organize different types of content:

NamespacePurposeExample
Main (no prefix)ArticlesPage_Title
Talk:Discussion about an articleTalk:Page_Title
User:Personal user pagesUser:JohnDoe
Template:Reusable wiki snippetsTemplate:Infobox
Category:Content categoriesCategory:Tutorials
Help:Help documentationHelp:Editing

User Permissions

Configure access in LocalSettings.php:

// Allow anyone to read, require login to edit
$wgGroupPermissions['*']['read'] = true;
$wgGroupPermissions['*']['edit'] = false;
$wgGroupPermissions['user']['edit'] = true;

// Create a private wiki (login required for everything)
$wgGroupPermissions['*']['read'] = false;
$wgGroupPermissions['*']['edit'] = false;
$wgGroupPermissions['user']['read'] = true;
$wgGroupPermissions['user']['edit'] = true;

Extensions

MediaWiki has thousands of extensions. Essential ones:

// VisualEditor — WYSIWYG editing (like WordPress)
wfLoadExtension( 'VisualEditor' );

// Scribunto — Lua scripting for advanced templates
wfLoadExtension( 'Scribunto' );

// Page Forms — Create form-based page creation
wfLoadExtension( 'PageForms' );

Install by downloading the extension into extensions/ directory and adding wfLoadExtension() to LocalSettings.php.

Common Mistakes

1. Forgetting to Back Up LocalSettings.php

This file contains your database credentials and all configuration. Without it, your wiki won’t work. Keep a secure backup.

2. Allowing Open Registration Without Anti-Spam

A default MediaWiki install lets anyone register. Add CAPTCHA and email confirmation:

wfLoadExtension( 'ConfirmEdit' );
$wgCaptchaTriggers['edit'] = true;
$wgCaptchaTriggers['create'] = true;
$wgEmailConfirmToEdit = true;

3. Ignoring Caching

MediaWiki can be slow without caching. Enable file cache or Redis:

$wgMainCacheType = CACHE_ACCEL;    // APCu
$wgMainCacheType = CACHE_REDIS;    // Redis

4. Using Rich Text When Plain Text Would Do

Not every page needs complex formatting. Simple wikitext is faster to write, easier to diff, and renders quicker than template-heavy pages.

Practice Questions

  1. What makes MediaWiki different from WordPress? Answer: MediaWiki is built for collaborative content creation. Every page has a full revision history, and anyone can edit. WordPress is built for one-to-many publishing with a single author.

  2. What is a namespace in MediaWiki? Answer: A namespace is a prefix that categorizes pages (e.g., Talk:, User:, Template:). Each namespace serves a different purpose and can have different permissions.

  3. How do templates work in MediaWiki? Answer: Templates are reusable wiki snippets stored in the Template: namespace. They are included in pages using {{TemplateName}} syntax and can accept parameters.

  4. Challenge: Set up a MediaWiki wiki, create 3 interlinked pages, add a category, and create a template for an infobox with name, version, and license parameters.

FAQ

Is MediaWiki only for Wikipedia-style sites?
: No. Many organizations use MediaWiki for internal documentation, knowledge bases, and collaborative reference material. It scales from small team wikis to Wikipedia-scale projects.
How does MediaWiki handle spam?
: Through extensions like ConfirmEdit (CAPTCHA), AbuseFilter (custom rules), and TorBlock (blocks Tor exit nodes). Email verification for new accounts is also recommended.
Can I use VisualEditor with MediaWiki?
: Yes. The VisualEditor extension provides a WYSIWYG editing experience similar to WordPress or Google Docs. It requires the Parsoid service.
How does MediaWiki compare to DokuWiki?
: MediaWiki is database-driven (MySQL) and more powerful for large-scale wikis. DokuWiki is flat-file (no database) and simpler to set up. MediaWiki is better for Wikipedia-scale projects; DokuWiki is better for small teams and personal wikis.

Try It Yourself

  1. Install MediaWiki on a local server or hosted environment
  2. Create a Main Page with links to 3 sub-pages
  3. Add a category and create a template
  4. Install the VisualEditor extension
  5. Configure user permissions to require login for editing

What’s Next

TopicDescription
DokuWikiFlat-file wiki alternative to MediaWiki
WordPressBlog and traditional CMS platform
PHPServer-side language MediaWiki is built on
MySQLDatabase engine used by MediaWiki
HTMLUnderstanding wiki output structure

What’s Next

Congratulations on completing this MediaWiki tutorial! Here’s where to go from here:

  • Practice daily — Consistency is more important than long study sessions
  • Build a project — Apply what you learned by building something real
  • Explore related topics — Check out other tutorials in the same category
  • Join the community — Discuss with other learners and share your progress

Remember: every expert was once a beginner. Keep coding!

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro