Creating Your First MediaWiki Page â Wiki Markup for Beginners
In this tutorial, you'll edit your MediaWiki wiki's Main Page, learn wikitext from scratch, and create your first real content. This is Lesson 3 of our project: Build Your Own Documentation Wiki.
What You'll Build Today
By the end of this lesson, your wiki's Main Page will have:
- A welcome heading and description
- Bold and italic text (correctly formatted)
- A bullet list of topics your wiki will cover
- A numbered list of steps for new visitors
- A section with sub-headings
You'll also understand the revision history â MediaWiki's built-in time machine.
Why Wikitext, Not a Visual Editor?
You might be thinking: "Why do I need to learn this weird text format? Why can't I just type like in Word?"
Good question. Wikitext has two big advantages:
- It's portable â The raw text is small, fast, and works everywhere. You can edit from any device, even a phone.
- Diffs are readable â When you compare two versions of a page (like in the history), you can see exactly what changed. With visual editors, diffs are messy and confusing.
Think of wikitext like learning to touch-type. It feels slow at first, but once you learn it, you're faster than anyone using a visual editor.
Step-by-Step: Edit Your Main Page
Step 1: Log In to Your Wiki
- Go to
http://localhost/mediawiki - Click the "Log in" link in the top-right corner
- Enter the username and password you created during installation
You must be logged in to edit. Your wiki is currently set to private mode â only you can edit it. We'll explore user permissions in Lesson 7.
Step 2: Open the Main Page for Editing
On your wiki's Main Page, look for the tabs at the top:
| Tab | Purpose |
|---|---|
| Page | View the page normally |
| Discussion | Talk page for discussing the article |
| Edit | Open the editor (this is what we want) |
| View history | See all past versions |
Click "Edit".
You'll see a text box containing the default Main Page content. It will look something like this:
<strong>MediaWiki has been installed.</strong>
Consult the [User's Guide](https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Configuration_settings)
for information on using the wiki software.
Don't worry about the existing text. We're going to replace it entirely.
Step 3: Clear the Page and Start Fresh
Select all the text in the editor and delete it. Then type this:
== Welcome to My Documentation Wiki ==
This wiki is a '''knowledge base''' for our team. Anyone can read it, and anyone can contribute.
== What You'll Find Here ==
* Project documentation
* API references
* Setup guides
* Troubleshooting tips
Now let's understand what you just wrote:
| Wikitext | What It Does | Example Output |
|---|---|---|
== Text == |
Level-2 heading (large) | A section divider |
'''Text''' |
Bold text | Text |
* Item |
Bullet list item | âĸ Item |
| Blank line | Separates paragraphs | New paragraph |
Step 4: Preview Before Publishing
Before you save, click the "Show preview" button at the bottom of the edit page.
This shows you exactly what your page will look like after publishing. The preview appears above the editor.
Always preview before saving. It catches formatting mistakes and saves you from having to make multiple tiny edits to fix typos.
Step 5: Write an Edit Summary
Look for the "Edit summary" box below the editor. Type:
Replaced default content with welcome page
The edit summary is a short note explaining what you changed. Other editors (including your future self) see this in the revision history. Good edit summaries make history readable.
Step 6: Publish Your Changes
Click "Publish changes".
Your page refreshes and now shows your content. The default MediaWiki welcome text is gone. Your wiki now has a proper Main Page.
Step 7: View the History
Click the "View history" tab at the top of the page.
You should see two entries:
- The initial page creation (MediaWiki's installer created this)
- Your edit â showing "Replaced default content with welcome page" as the summary
Click the link that says "cur" (current) next to your edit. This shows a "diff" â a comparison of the old version and your new version. You'll see:
- Red highlighted lines: what was removed
- Green highlighted lines: what was added
This is MediaWiki's superpower. Every single change is tracked forever.
Add More Content
Now let's add to your Main Page. Click "Edit" again and add these sections after your existing content:
== Quick Start ==
To get started with this wiki:
# Click "Edit" on any page to contribute
# Use '''bold''' for key terms
# Use [[Page Title]] to link to other pages
# Always write an edit summary
== Need Help? ==
Check the [[Help:Contents|Help pages]] for formatting guides.
Here's what's new:
| Wikitext | What It Does | Example Output |
|---|---|---|
# Item |
Numbered list | 1. Item |
[[Page Title]] |
Link to another page | Page Title |
[[Help:Contents\|Help pages]] |
Link with custom display text | Help pages |
The [[Help:Contents|Help pages]] syntax creates a link to the page Help:Contents but displays the text Help pages. The pipe character | separates the target from the display text.
Notice the link [[Help:Contents|Help pages]] appears in RED. In MediaWiki, red links mean the target page doesn't exist yet. Clicking it will let you create that page. We'll cover this more in Lesson 4.
What You Learned
- Wikitext basics:
'''bold''',''italic'',== headings ==,* lists,# numbered lists - How to edit, preview, and publish
- What an edit summary is and why it matters
- How to view history and compare versions
- Red links mean pages that don't exist yet
In the next lesson, you'll create new pages and link them together into a real wiki structure.
Common Errors
| Error | Why It Happens | How to Fix |
|---|---|---|
Text shows '''bold''' instead of actually being bold |
You might be using straight quotes vs single quotes. Make sure you're using the apostrophe key (next to Enter), not the backtick. The pattern is exactly 3 single quotes on each side. | Type '''bold''' carefully â no spaces between the quotes and the word. |
| "Edit" tab is missing | You're not logged in | Click "Log in" in the top-right corner with your admin account. |
| White page after publishing | A PHP error in your wikitext (usually from a template or extension) | This is rare with plain wikitext. Go back and check for unmatched brackets or quotes. |
| "Your edit was not saved" (session error) | Your login session expired | Log out and log back in. If it happens frequently, check your PHP session settings. |
| Preview looks different from published page | Caching | Wait a few seconds and refresh. If it persists, clear your browser cache. |
| I made a mistake and want to undo | History is your friend | Go to "View history", find the previous version, click the date to view it, then click "Edit" and re-save that version. Or use the "undo" link next to your edit in the history. |
FAQ
How do I delete a page in MediaWiki?
Replace all the content with __NOINDEX__ and add the template {{Delete|reason for deletion}}. Administrators can delete pages permanently through the "Delete" action (available in the page tools menu or by going to index.php?title=PageName&action=delete).
What if I accidentally delete all the content?
It's nearly impossible to lose content in MediaWiki. Every version is in the history. Go to "View history", find the version before your mistake, click the date, click "Edit", and save it again. Your content is restored.
Can I use HTML instead of wikitext?
Yes, but wikitext is preferred. MediaWiki allows some HTML tags (like <div>, <span>, <table>) but not all. It's better to learn the wikitext equivalent â it makes diffs cleaner and pages more consistent.
How do I add an image to a page?
First upload the image through Special:Upload. Then add it to a page with: [[File:MyImage.png|thumb|Caption text]]. The thumb parameter creates a thumbnail, and the caption appears below it.
The formatting looks different from what I expected
Check for extra spaces. In wikitext, a space at the start of a line creates a <pre> block (monospaced text). If your list items aren't showing as a list, make sure there's no space before the * or #.
What's Next
Your Main Page is set up with headings, lists, and links. But those red links mean pages that don't exist yet â let's fix that.
Continue to Lesson 4: Linking Pages & Using Categories â you'll create new pages, link them together, and organize them with categories.
Built by the developers of DodaTech
Doda Browser, DodaZIP & Durga Antivirus Pro