A page name refers to the title of a page within the wiki. The title appears at the top of the page content. Within the MediaWiki site, the page names are used to identify and link to different pages.
Page names are also case-sensitive, except for the first letter, which is always capitalized by default.
For example: Manual:Page naming is different from Manual: Page nAming
A page name may contain two parts:
Namespace:Title
For example, this page exists in the Manual namespace .
In a URL, spaces are allowed in page names and are automatically converted to underscores (_
). For example, My Page
becomes My_Page
.
MediaWiki provides several magic words to handle and manipulate page names.
Returns the title of the current page.
"{{FULLPAGENAME}}"
→ "Manual:Page naming" [1]Converts a page name to a form suitable for use in a URL by replacing spaces with underscores and encoding special characters.
"{{FULLPAGENAMEE:Manual:Newlines and spaces}}"
→ "Manual:Newlines_and_spaces" [2]Lists or extracts the namespace of a given page name.
Removes the namespace from a given page name and renders the page's title only.
"{{PAGENAME:Help:Magic words}}"
→ "Magic words" [5]Returns the base name of the page by removing the namespace and going up one level.
"{{BASEPAGENAME:User:A/b/c}}"
→ "A/b" [6]Returns the last part of the page name after the last slash.
"{{SUBPAGENAME:Help:Wikitext examples/transclusion demo}}"
→ "transclusion demo" [7]Returns the namespace and title of the associated content page. This is similar to FULLPAGENAME
.
"{{SUBJECTPAGENAME}}"
→ "Manual:Page naming" [8]Returns the namespace and title of the associated talk page.
"{{TALKPAGENAME}}"
→ "Manual talk:Page naming" [9]Invalid page names - If the provided page name is invalid, these magic words return an empty string.
"{{TALKPAGENAME:a[b}}"
→ "" [10]Maximum length - The maximum length for a page name without the namespace is 255 bytes. Exceeding this will return an empty string.
"{{FULLPAGENAME:help:abcdefghijklmnopqrstuvwxyz...}}"
→ "Help:Abcdefghijklmnopqrstuvwxyz..." [11]Interwiki prefixes - Some magic words behave differently if the input contains interwiki prefixes, which are not capitalized and handled according to the local settings of the wiki.
"{{FULLPAGENAME:ab:cdef}}"
→ "ab:cdef" [12]Namespace with colon only - A namespace followed by a colon without a page name is not considered a valid page name and returns an empty string.
"{{FULLPAGENAME:help:}}"
→ "" [13]These magic words help you manage and manipulate page names, making it easier to create dynamic and flexible wiki content.
Page title restrictions[edit]When creating page titles in MediaWiki, there are specific restrictions and special cases to be aware of. This guide simplifies these rules to help you avoid issues.
Special characters[edit]The following characters are not allowed in page titles (See Manual:$wgLegalTitleChars , deprecated):
# < > [ ] | { }Reasons for restrictions[edit]
These characters are prohibited because they have special meanings in MediaWiki syntax.
For example:
[[tc]] links to a page titledTc
, not [[tc]]. {{tc}} refers to Template:Tc, not {{tc}}. Testing page names[edit]
You can test if a page name is allowed by trying to create a link to it:
Write Gives Note[[a#b]]
a#b links to anchor b
on page a
[[#b]]
#b links to anchor b
on the current page [[a|b]]
b piped link to page a
[[a%2f]]
a/ %2f
is a slash, so page names cannot contain slashes [[:/b]]
/b prefix with a colon to link [[a_b]]
a_b underscore and space are equivalent, but the underscore is displayed
[[a b]]a b no consecutive spaces in page names
Backslash (\
):
May be converted to a forward slash (/
) depending on context.
Forward slash (/
):
It provides a special functionality in some namespaces.
To link to a page in the main namespace starting with /
, use a colon: [[:/page]]
.
Namespace prefixes:
Page names cannot start with a generic namespace prefix. For example, an album titled Help: A Day in the Life in the English Wikipedia is called Help!: A Day in the Life to avoid being in help namespace.
Length limitations:
Maximum length: 255 bytes (excluding namespace prefix).
Non-ASCII characters may use up to 4 bytes each.
For example, this link tests the maximum page name length: 255 characters.
File namespace: 240 bytes for new uploads.
First character restrictions
Cannot be a colon (:
), space (
), or underscore (_
).
Slashes (/
) and percent signs (%
) have special handling. For example, %
followed by certain characters can cause issues (e.g., [[%23]] becomes #
).
When naming pages, a space and an underscore function the same way:
For example:
This means you don't need to worry about using spaces or underscores—they work interchangeably depending on where they appear.
Case-sensitivity in page names[edit] Namespace prefixes[edit].jpg
or .JPG
) are always case-sensitive.This means Stop_sign_us.jpg
and Stop_sign_us.JPG
are considered two different files.
By understanding these rules, you'll be better equipped to manage and navigate pages accurately!
Handling spaces and underscores in page names[edit]When working with page names, it's important to know how spaces and underscores are treated.
Ignored spaces and underscores[edit]Certain spaces and underscores are automatically ignored or treated as equivalent:
Pattern Example Before and after the page name[[ Help ]]</source> → [[ Help ]] |- | Following a namespace prefix and before a colon | <syntaxhighlight lang=mediawiki inline>[[Project :Help]]→ Project :Help After the colon of a namespace prefix
[[Project: Help]]
→ Project: Help Duplicate consecutive spaces
[[Help:Talk page]]→ Help:Talk page Visible changes in link labels[edit]
In some cases, spaces and underscores may still appear in the link labels even if they are ignored in the actual page link:
[[___help__ :_ _template_ _]]
is treated as Help:Template, but may display as ___help__ :_ _template_ _
When creating a page name, certain characters are automatically converted to their corresponding characters. This is known as URL encoding. For example:
%41
is the URL-encoded version of the letter A
. So, if you try to name a page [[%41]], it will automatically be treated as A.%C3%80
is the URL-encoded version of the letter À
. Similarly, [[%C3%80]] will be treated as À.In other words, even though you might try to use %41
or %C3%80
as page names, they will be converted to A and À, respectively. This means that pages with these names will not be distinct— %41
will always be the same as A, and %C3%80
will always be the same as À. For example, if you create a page named À, its URL might look like http://mediawiki.org/wiki/%C3%80, but the actual page name will be À.
When you reference a page using special tags, the system automatically formats the page name to a standard form called the "canonical form". Here's how it works:
:PageName
), it is removed._
) are turned into spaces.A few examples:
"{{:qwsazx}}"
→ "Qwsazx" [14]When organizing page names alphabetically, the system follows a specific order.
!
, @
, #
appear before letters._
). This means spaces are sorted after capital letters but before lowercase letters.RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4