MediaWiki Cite & References — Footnotes, Citation Templates, and CiteThisPage
In this tutorial, you will learn about MediaWiki Cite & References. We cover key concepts, practical examples, and best practices to help you master this topic.
Citations and references in MediaWiki use the Cite extension for footnotes, reusable citations, and reference lists — with citation templates for consistent formatting and CiteThisPage for automated citation export, the same reference system Wikipedia uses to verify its content.
What You'll Learn
- Installing and using the Cite extension
- Creating inline footnotes
- Grouping and separating references
- Reusing citations across a page
- Creating citation templates for consistent formatting
- Using the CiteThisPage extension
- Best practices for wiki citations
Why It Matters
Documentation wikis need credible sources. Without citations, readers cannot verify claims. In technical documentation, citations link to standards, API references, and authoritative sources. In knowledge bases, they build trust. The Cite extension makes adding footnotes as simple as wrapping text in <ref> tags. The reference list auto-populates at the bottom of the page. This system scales from a single footnote to hundreds of references across a book-length document.
Real-World Use
A DodaTech API documentation page cites four external sources: the official REST API specification, a research paper on the algorithm used, a security standard the API follows, and a related tool's documentation. Each citation uses a consistent template. Readers see inline superscript numbers and a formatted reference list at the bottom. A developer exports the citations in BibTeX format for inclusion in a research paper.
Learning Path
flowchart LR A["27: VisualEditor"] --> B["28: Scribunto & Lua"] B --> C["29: Cite & References"] C:::current D["30: Interwiki Links"] E["31: Wiki Farms"] F["32: Content Translation"] C --> D --> E --> F classDef current fill#38bdf8,color#0f172a,stroke-width:2px
Step 1: Install the Cite Extension
The Cite extension is bundled with MediaWiki but may not be enabled by default.
Enable Cite
In LocalSettings.php:
wfLoadExtension( 'Cite' );
That is all. Cite has no configuration options. After enabling, the <ref> and <references/> tags work immediately.
Verify Installation
Create a test page:
This is a statement that needs a source.<ref>Author (2026). ''Title of Source''. Publisher.</ref>
== References ==
<references/>
Save and check that the footnote appears as a superscript number and the reference list shows the citation at the bottom.
Step 2: Basic Footnotes
Single Footnote
MediaWiki was first released in 2002.<ref>Manske, Magnus. "MediaWiki History." MediaWiki.org, 2002.</ref>
The <ref> tag wraps the citation text. MediaWiki automatically:
- Numbers each footnote sequentially
- Creates a superscript link from the footnote number to the reference list entry
- Creates a backlink from the reference list to the footnote location
Multiple Footnotes on One Page
Each <ref> tag gets the next sequential number:
Statement one.<ref>Source A</ref>
Statement two.<ref>Source B</ref>
Statement three.<ref>Source C</ref>
Renders as: Statement one.[1] Statement two.[2] Statement three.[3]
Reference List Placement
Place <references/> where you want the reference list to appear. It is standard to put it in a "References" or "Notes" section at the bottom of the page:
== References ==
<references/>
Without <references/>, footnotes still appear but at the very bottom of the page.
Step 3: Named References (Reusable Citations)
When you cite the same source multiple times, use a named reference.
Defining a Named Reference
MediaWiki runs on PHP.<ref name="php">PHP Group. "PHP Documentation." php.net, 2026.</ref>
The name attribute gives the reference a unique identifier.
Reusing a Named Reference
Use an empty ref tag with the same name:
The latest version requires PHP 8.2.<ref name="php" />
MediaWiki renders both citations with the same number. The reference list shows the source only once, with all footnote locations listed.
Named Reference Rules
- The name must be unique on the page
- The first occurrence defines the citation text
- Subsequent occurrences use an empty tag with just the name
- Names are case-sensitive
Step 4: Reference Groups
Separate different types of references into groups.
Defining a Group
The server runs on Linux.<ref group="note">The production server uses Ubuntu 24.04.</ref>
The API response format is JSON.<ref>API Documentation, DodaTech, 2026.</ref>
Grouped Reference List
== Notes ==
<references group="note" />
== References ==
<references/>
Footnotes with group="note" appear only in the "Notes" section. Footnotes without a group appear in the main "References" section. This separates content notes from source citations.
Common Group Names
note: Editorial noteslower-alpha: Alphabetical footnotesupper-alpha: Uppercase alphabeticallower-roman: Roman numeral footnotes
Step 5: Citation Templates
Citation templates ensure consistent formatting across all references. Create a template that wraps <ref> tags.
Creating a Citation Template
Create Template:Cite web:
<ref>{{{
|url={{{url|}}}
|title={{{title|}}}
|author={{{author|}}}
|date={{{date|}}}
|publisher={{{publisher|}}}
}}}</ref>
However, this approach is not recommended because it nests template calls inside ref tags, which can cause Parsing issues.
Better Approach: Template for Citation Formatting
Create Template:Citation that formats the citation text:
''{{{title}}}''{{#if:{{{author|}}}| by {{{author}}}}}{{#if:{{{date|}}}| ({{{date}}})}}{{#if:{{{url|}}}| [{{{url}}} Link]}}.
Usage:
MediaWiki supports extensions.<ref>{{Citation
|title=MediaWiki Extensions
|author=MediaWiki Contributors
|date=2026
|url=https://www.mediawiki.org
}}</ref>
Predefined Citation Templates
Wikipedia uses extensive citation templates:
{{Cite web}}: Web sources{{Cite book}}: Books{{Cite journal}}: Academic articles{{Cite news}}: News articles{{Cite press release}}: Press releases
Install the "Citoid" extension to enable auto-completion of citation templates from URLs.
Step 6: CiteThisPage Extension
The CiteThisPage extension adds a "Cite this page" link to the sidebar, generating formatted citations in multiple styles.
Installation
cd /opt/lampp/htdocs/mediawiki/extensions
git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/CiteThisPage.git
cd CiteThisPage
git checkout REL1_42
Enable:
wfLoadExtension( 'CiteThisPage' );
Usage
Go to Special:CiteThisPage or click "Cite this page" in the toolbox. The page shows:
Cite this page
APA style:
DodaTech. (2026). DodaBrowser. Retrieved June 28, 2026, from
https://wiki.dodatech.com/wiki/DodaBrowser
MLA style:
"DodaBrowser." DodaTech Wiki. DodaTech, 28 Jun 2026. Web. 28 Jun 2026.
BibTeX:
@misc{ wiki:xxx,
author = "DodaTech",
title = "DodaBrowser --- DodaTech Wiki",
year = "2026",
url = "https://wiki.dodatech.com/wiki/DodaBrowser"
}
Configure Citation Styles
// Enable or disable specific citation formats
$wgCiteThisPageFormats = [
'apa' => true,
'mla' => true,
'bibtex' => true,
'chicago' => true,
'vancouver' => true,
];
Step 7: Embedded References
For long documents, references can become unwieldy. Embed references in a separate page and transclude them.
Reference Page
Create DodaBrowser/References:
<ref name="spec">API Specification v2.1, DodaTech, 2026.</ref>
<ref name="security">Security Best Practices, OWASP, 2025.</ref>
Transcluding References
On the main page:
== References ==
<references/>
{{DodaBrowser/References}}
The transcluded page fills the <references/> section with the predefined citations. Other pages can transclude the same reference page for consistency across the wiki.
Step 8: Best Practices
Citation Guidelines
- Cite as you write: Add references while writing, not at the end
- Use named references: Reuse citations instead of duplicating them
- Informative citation text: Include title, author, date, publisher, and URL
- Use consistent format: Citation templates enforce consistency
- Verify URLs: Check that linked sources still exist
Reference List Placement
The standard layout is:
== See also ==
* [[Related page 1]]
* [[Related page 2]]
== Notes ==
<references group="note" />
== References ==
<references/>
What You Learned
<ref>tags create footnotes with automatic numberingnameattribute enables reusable citationsgroupattribute separates different reference types- Citation templates enforce consistent formatting
- CiteThisPage exports citations in APA, MLA, BibTeX, and more
- Transcluded reference pages keep citations consistent across pages
<references/>generates the reference list automatically
In the next lesson, you'll learn about interwiki links.
Common Mistakes
| Mistake | Why It Happens | How to Fix |
|---|---|---|
| Reference list not appearing | Missing <references/> tag |
Add <references/> where you want the reference list. Without it, footnotes still display but without a formatted list. |
| Named reference not working | Name mismatch or wrong syntax | Ensure the name is spelled identically in both the definition and reuse tags. The reuse tag must be <ref name="same" /> (self-closing). |
| Reference group content appears in main reference list | No group parameter on <references/> |
Use <references group="name" /> for grouped references. Ungrouped references go to the default <references/>. |
| Citation template shows raw code | Missing parameter values | Check that the citation template has defaults or handles missing parameters gracefully. Use #if parser functions to hide empty fields. |
| CiteThisPage not appearing in sidebar | Extension not enabled | Verify wfLoadExtension('CiteThisPage') is in LocalSettings.php. Check that the sidebar link is configured in the skin. |
Practice Questions
- What is the difference between a named reference and a grouped reference?
- How would you create a footnote that cites the same source three times but only shows it once in the reference list?
- What citation formats does CiteThisPage support?
- Challenge: Build a complete citation system. Install Cite and CiteThisPage. Create a page with 5 statements, each citing a different source using
<ref>tags. Reuse one source at least twice with a named reference. Create a "Notes" group for editorial comments separate from citations. Create a citation template called "CiteSource" that formats references as: "Author, Title (Publisher, Year)." Use CiteThisPage to export the page's citations in APA and BibTeX formats. Verify all backlinks between footnotes and the reference list work correctly.
FAQ
{{< faq "How do I fix a broken backlink from a reference to its footnote?" "Ensure the tag is properly closed. Named references must use the correct syntax: <ref name="x">Content for definition and <ref name="x" /> for reuse. Misplaced or unclosed tags break backlinks." >}}
Mini Project
Goal: Build a fully cited documentation page with multiple reference types.
- Create a wiki page called "DodaSync Security Overview"
- Write 5 statements about DodaSync security features
- Cite each statement with appropriate sources:
- One from the DodaTech website (cite web)
- One from a book on cryptography (cite book)
- One from a security standard (cite web with organization)
- One from an interview (custom citation)
- One from an industry report
- Use named references where appropriate
- Create a separate "Notes" section with a group for clarification notes
- Create a citation template that formats all citations consistently
- Add a "References" section at the bottom
- Install CiteThisPage and verify the export works
- Add "See also" links to related security topics
What's Next
Citations make your wiki credible. Now let's connect your wiki to the wider world with interwiki links.
Continue to Lesson 30: Interwiki Links — learn how to create cross-wiki shortcuts, configure interwiki prefixes, and link to Wikimedia projects.
Built by the developers of DodaTech
Doda Browser, DodaZIP & Durga Antivirus Pro