For information on choosing the best title for a Wikipedia article, see Wikipedia:Article titles.
For a simpler explanation of "page name" and "pagename", see Help:Page name.
Name of a Wikipedia article. The wikilink for that article is Salvo D'Acquisto, and the URL is http://en.wikipedia.org/wiki/Salvo_D'Acquisto.

Page name is a term that is used to refer to any page that is sent from a Wikipedia database. But page name usually doesn't refer to virtual namespaces, like Special or Media pages. The page name is normally the same as the displayed title; the displayed title is shown on the title line, near the top of the page, in a big font. But the displayed title can be altered slightly from the page name without affecting things much, see Changing the displayed title below

Page names are used to title pages, to navigate to pages, to search for pages, and for things like transclusion and substitution. Page names also conveniently serves as link names in wikitext, if enclosed in double square brackets, like [[Page name]]. If a page is moved, the page name will also move.

Page names are also the same as the last part of the URL of Wikipedia pages, that is after the last slash (/); except that some translation occurs, such as spaces are replaced with underscores. For example, the Main page of Wikipedia has no title, but a link can be formed from the last part of the URL, such as [[Main_page]] or [[Main page]]. The MediaWiki software, that drives Wikipedia, will interpret all the possible URL characters correctly, see Spaces, underscores, and character encoding below. But with pages in the revision history database, URLs are different, and only the full URL can be linked; the URL includes the page name, but also an oldid value, in the permanent and unique form Page_name&oldid=value. See Help:Page history for more details.

The MediaWiki software has aspects of the page name stored in three variables: fullpagename, pagename (note no space in pagename), and namespace. The variable namespace describes the particular namespace of a page, which is like a collection of pages; in Wikipedia there are 31 different ones. In Main namespace, the context is usually content,[1] as encyclopedic articles are all kept there. In Main namespace, page name is equivalent to fullpagename and pagename. Outside of Main namespace, both page name and fullpagename are equivalent to Namespace:Pagename. So pagename is most useful in contexts relating to articles, and fullpagename is most useful in all other contexts. The variables namespace, pagename and fullpagename, can be rendered with the "magic words" {{NAMESPACE}},{{PAGENAME}}, and {{FULLPAGENAME}}. These magic words, when added to the wikitext of pages, render uniquely on each page they are included on.

Namespace, pagename, and fullpagename

The page name is Help:Categories. The pagename is Categories.

On Wikipedia, there are three main variables used for the purpose of naming pages: pagename, namespace, and fullpagename. Note that the variable pagename (without a space in the middle), is different to the page name (with a space in the middle).

The first variable to consider is pagename. Pagename is the basis for page naming on Wikipedia. It is also sometimes called the basename, as it corresponds to the concept of basename in Unix. On encyclopedic articles, it is usually the same as the article title (although it is possible to alter article titles slightly, as explained later). For example, for the article Potato, pagename would be Potato.

But for the naming of non-article pages on Wikipedia, the variable namespace is also needed. Namespace is named after the computer science concept of namespace. It can be thought as specifying a collection of pages, with each individual page in a particular collection specified by pagename. On Wikipedia, there are, at present, a total of 31 namespaces (excluding aliases and pseudo-namespaces). Each page within a particular namespace has a different pagenames. Encyclopedic articles reside in a single namespace called Main namespace.

The variable fullpagename is an amalgamation of namespace and pagename. It corresponds to the page name (note the space in page name) of a page, and hence a page's title. It normally takes the form Namespace:Pagename (i.e. namespace, then a colon character, then pagename). But with pages in Main namespace, it just takes the form Pagename. So:

  • For pages in Main namespace (e.g. articles), page name, fullpagename and pagename are the same. For example: the article Copyright has Copyright as page name, fullpagename and pagename; and the namepace is Main.
  • But for pages in all other namespaces, page name and fullpagename is the same as Namespace:Pagename. For example: the page Help:Copyright has Help:Copyright as page name and fullpagename; Help as namespace; and Copyright as pagename.
  • Fullpagename, page name (with a space), and the page's displayed title are usually the same, although there are methods of altering the displayed title slightly from fullpagename, see 'Changing the displayed title' below for details. Also, URLs of pages in the revision history database incorporate an oldid number.

Namespaces in Wikipedia is a powerful concept. As well as organising all the pages into 31 collections, it also allows pages in different namespaces to share a pagename. See the above example. Another example is the pages Wikipedia:Disambiguation and Help:Disambiguation:

  • The page name and fullpagename Wikipedia:Disambiguation, has Wikipedia as namespace, and Disambiguation as pagename.
  • The page name and fullpagename Help:Disambiguation, has Help as namespace, and Disambiguation as pagename.

Subpages

Further information: Wikipedia:Subpages

Except in main namespace (article namespace), where the subpage feature has been disabled in the English Wikipedia, subpages are pages separated with a "/" (a slash) from their 'parent' page. Pages that includes a / (slash) are then a subpage. The page is considered "subordinate" to its host page, and is titled and linked as [[Parentpage/Subpage]]. It is possible to create a subpage of a subpage (or a sub-subpage). At the top of each subpage or sub-subpage, you can find a backlink (a.k.a. breadcrumb) to the higher levels of the page.

An example is Wikipedia:Userboxes/Media/Film which is a subpage of Wikipedia:Userboxes/Media. In this example, the page name and fullpagename is Wikipedia:Userboxes/Media/Film, and it has Wikipedia as namespace, and Userboxes/Media/Film as pagename. Likewise Wikipedia:Userboxes/Media is a subpage of Wikipedia:Userboxes.

Virtual namespaces

Page name, and related variables, are usually not used to refer to pages from the two virtual namespaces, Special and Media. They are not editable in the usual way, as their HTML is automatically generated each time they are accessed. Page names in virtual namespaces are in the form Namespace:Pagename, they do not follow the usual rules. Their displayed titles do not correspond to their page names in the usual manner; for example, the title of Special:SpecialPages is 'Special pages'. Page from a virtual namespace can be linked to, but the link cannot conveniently use the page's title. Also, their URLs can sometimes be significantly different to standard URLs, especially when they are carrying out tasks. They can be transcluded, but only in certain circumstances. And search is not possible in the normal way.

Magic words and page name

As explained earlier, the fullpagename, pagename and namespace of a page can be rendered by placing the 'magic words' {{FULLPAGENAME}}, {{PAGENAME}} and {{NAMESPACE}} in the wikitext. These three magic words must all be in capitals. These and related magic words also have parsing abilities, see meta:Help:Page name for more information on this.

FULLPAGENAME, fullpagename and page name

The magic word {{FULLPAGENAME}} renders the fullpagename of a page if inserted in the wikitext of a page. Now the fullpagename of a page will generally be the same as the page name (note the space in page name), and hence the page's title as explained earlier. The only time the fullpagename will be different to the page's title, is if the displayed title is changed by a method detailed in the 'Changing the displayed title' section beneath; for example, by using the magic word {{DISPLAYTITLE:title}}.

PAGENAME and pagename

The magic word {{PAGENAME}} renders the pagename (note there is no space in pagename) of a page if inserted in the wikitext of a page. As explained earlier, the fullpagename will be the same as pagename only if the page is in Main namespace (e.g. for encyclopedic articles); in other namespaces, fullpagename will be the same as 'namespace:pagename.'

NAMESPACE and namespace

The magic word {{NAMESPACE}} usually renders the namespace of a page if inserted in the wikitext of a page. The only time this doesn't happen is in Main namespace, where {{NAMESPACE}} will render a blank instead.

Subpages

Subpages are also rendered by these magic words. For example, for the page named Wikipedia:Userboxes/Media/Film, fullpagename would be Wikipedia:Userboxes/Media/Film, pagename would be Userboxes/Media/Film, and namespace would be Wikipedia.

Some examples

As an example, for the article Notability: the page name, {{FULLPAGENAME}} and {{PAGENAME}} would be Notability; and {{NAMESPACE}} would be blank. And for the page Wikipedia:Notability: the page name and {{FULLPAGENAME}} would be Wikipedia:Notability; {{NAMESPACE}} would be Wikipedia; and {{PAGENAME}} would be Notability.

Related magic words

Adding an E to the end of these variables, like {{FULLPAGENAMEE}}, renders these variables encoded for use in MediaWiki URLs, i.e. with underscores replacing any spaces. Additional magic words for related variables include {{ARTICLEPAGENAME}}, {{ARTICLESPACE}}, {{BASEPAGENAME}}, {{SUBJECTPAGENAME}}, {{SUBJECTSPACE}}, {{SUBPAGENAME}}, {{TALKPAGENAME}}, {{TALKSPACE}}. See Help:Magic words for more details.

Problematic names

Wikipedia:Article titles describes the policy for the correct naming of articles. But there are also technical restrictions to the naming of articles on Wikipedia, which are mostly listed at Wikipedia:Naming conventions (technical restrictions). The section Technical restrictions and limitations on this page gives additional details. The section Changing the displayed title explains how they can sometimes be overcome.

Forward slash (/) in pagenames provides special functionality in a namespace where the subpage feature has been enabled. This feature is not active in Wikipedia's Main namespace, so a forward slash in an article name has no particular effect; but it may affect the behaviour of the corresponding talk page, as subpages are enabled in Main Talk namespace. An example is the article GNU/Linux naming controversy; it doesn't have a subpage, but the talk page Talk:GNU/Linux naming controversy is a subpage of Talk:GNU. But this doesn't particularly cause problems.

Technical restrictions and limitations

For information on how to treat pages whose titles are affected by these limitations, see Wikipedia:Naming conventions (technical restrictions).

In general, a pagename can be any string of one or more Unicode characters. However, some strings of Unicode characters cause technical problems with the way Wikipedia functions, and so are limited or restricted.[2] Note that these rules mostly apply to namespace as well as pagename. These limitations and restrictions include:

  • A pagename cannot begin with a lowercase letter in any alphabet.[3]
  • A pagename cannot contain any of the following characters: # < > [ ] | { } _ (which all have special meanings in wiki syntax); the non-printable ASCII characters (coded 0–31 decimal); the delete character (coded 127 decimal); the Unicode replacement character U+FFFD ; or any HTML character codes, such as &amp;.[4] A pagename also cannot contain 3 or more continuous tildes ~~~, as these are used for marking signatures on Wikipedia.
  • A pagename cannot begin with a colon :.
  • A pagename cannot be . or ..; or begin with ./ or ../; or contain /./ or /../; or end with /. or /...
  • A pagename cannot exceed 255 bytes in length. Be aware that non-ASCII characters may take up to four bytes in UTF-8 encoding, so the total number of characters that can fit into a title may be less than 255.
  • A pagename cannot begin with any kind of namespace prefix, except a pseudo-namespace prefix by definition.

Namespace prefixes include: all subject and talk namespace prefixes (e.g. Wikipedia: and User:). Virtual namespace prefixes (Special: and Media:). Namespace aliases (e.g. WT:). Interwiki linking prefixes (e.g. Wikt: for Wiktionary; Q: for Wikiquote). Interlanguage link prefixes (e.g. fr:, en:). For example, an article about the album Q: Are We Not Men? A: We Are Devo! has the pagename Are We Not Men? We Are Devo! because of the Q:.

Article titles beginning with a namespace prefix (e.g. Wikipedia: The big adventure) are technically possible. However, the article would be in the wrong namespace, which would interfere with search and other functionality, and that space after the colon would have to be added with DISPLAYTITLE as described below. In such situations, the naming conventions recommends redirecting to an alternative title within mainspace. For example, the article Project: Mersh is named Project Mersh, as Project: is a namespace alias for the Wikipedia: namespace.

  • A pagename cannot consist of only a namespace prefix.
  • A pagename cannot begin or end with a space (which would be translated to an underscore in the URL).
  • A pagename cannot contain % followed by 2 hexadecimal digits, unless for a percent-encoded character, although there are exceptions.

A pagename can have the character %, but it must be percent-encoded as %25 in the URL, to prevent it from being interpreted as a single character. To prevent ambiguity, pagenames cannot contain % followed by 2 hexadecimal digits.

  • With namespaces, no capitalization of a namespace name, apart from the first letter, is allowed. Also, no spaces (which are translated to underscores) are allowed before or after the colon of a namespace name. For example, the following are not allowed: HELP:, HeLp:, Help_: or Help:_ (with spaces rather than underscores).

Changing the displayed title

For more information, see Template:DISPLAYTITLE.

It is possible to change the way a page title is displayed at the top of its page. This should only be done if the article meets the criteria for a non-standard title format, as detailed in the Article titles policy. The displayed title format is changed using the magic word DISPLAYTITLE. Under the present software configuration, only limited modifications can be made: the displayed title must still resolve to the true name of the page; i.e. if the displayed title is copied and pasted into a wikilink, the link should point to the original page. DISPLAYTITLE allows many formats: changing an initial letter to lower case; adding initial colons; changing spaces to underscores; adding a space after a namespace prefix; and adding formatting such as italics, bolding, superscripts, subscripts, etc.. But forbidden characters are not supported by DISPLAYTITLE. Since 2013 it is not possible to hide part of the title with <span style="display:none;">...</span>.

The syntax for DISPLAYTITLE is {{DISPLAYTITLE:Desired Title}}. However it is often applied through a template. Currently available templates are {{lowercase title}}, used on such articles as eBay and iPod; and {{italic title}}, commonly used for scientific names. Both of these templates will work irrespective of where they are placed in the wikitext, but it is normal to place them at the beginning. There are also some infoboxes (such as {{Infobox film}}) which include a built-in DISPLAYTITLE to italicize the page title.

If there is more than one instance of DISPLAYTITLE with allowed modifications, and they do not all specify the same title, only the last such instance is enacted, with an error message generated. For example:

Warning: Display title "<i>Desired title</i>" overrides earlier display title "<i>Desired</i> title".

The preferred solution to this problem is to remove or disable one of the instances of DISPLAYTITLE. If this is not possible due to template limitations, etc., then the error message may be suppressed by using the "noerror" parameter, i.e. {{DISPLAYTITLE:Desired Title|noerror}}. If you use this technique, you should be aware that the last instance of DISPLAYTITLE overrides the previous ones. This means that if the DISPLAYTITLE automatically generated by an infobox template needs to be overridden, then an explicit DISPLAYTITLE must be placed after the infobox to make it work.

A DISPLAYTITLE with disallowed modifications is ignored. It will not prevent a previous DISPLAYTITLE with allowed modifications from working, and it will not generate an error message if there is a later DISPLAYTITLE.

Note that parameters for DISPLAYTITLE should be passed using a colon (:) rather than a vertical bar (|): {{DISPLAYTITLE:Desired Title}} is preferred to {{DISPLAYTITLE|Desired Title}}. The reason for this is that it then bypasses the Template:DISPLAYTITLE completely, to access the magic word directly.

Alphabetical order

Where page titles are placed in alphabetical order by the system (as at Special:AllPages), Unicode-based ordering is used rather than the truly alphabetical ordering that would be expected. For details, see Help:Alphabetical order.

Spaces, underscores and character coding

In page names, a blank space is equivalent to an underscore. A blank space is displayed in the large font title at the top of the page, while the URLs show an underscore. Wikilinks can use either spaces or underscores (spaces are preferred in article space).

Percent-encoded character codes, such as %41 (which codes A) and %C3%80 (which codes À or A-grave), are treated in pagenames as equivalent to their corresponding characters. The codes are generally used for most non-alphanumeric and non-ASCII characters in URLs; although the characters themselves may sometimes work as well, depending on browser. The reason why %C3%80 works is because the UTF-8 for A-grave is C380 hex.

Codes are converted into corresponding characters in link labels: [[%41]] and [[%C3%80]]] are rendered as A and À. The URL of the latter page is http://en.wikipedia.org/wiki/%C3%80 or http://en.wikipedia.org/wiki/À. It can be disputed whether the "real" name of the page is %C3%80 or À, but in any case there cannot be distinct pages with these names.

In some cases, such as in templates, it is necessary to convert a page name represented by a variable into a form suitable for use in URLs: with underscores for spaces and with % codes for special characters. This can be done using the magic words described below; for full details, see mw:Help:Magic words.

  • Certain magic words ending with an extra "E", such as PAGENAMEE, NAMESPACEE, etc., return URL-encoded page names. For example, for this page, {{FULLPAGENAMEE}} gives Wikipedia:Page_name.
  • The localurl and fullurl functions can be used to generate relative and full URLs to a particular page. Fullurl can also be used for interwiki references; but may not work for links to pages on a project with a different $wgScript.

If pagename variables are used within the localurl or fullurl functions, then use standard variables like {{PAGENAME}} etc., in the first parameter, where they will be encoded anyway; but then use "EE" variables, like {{PAGENAMEE}} etc., in the second parameter, the query string, if present. For example:

  • {{fullurl:Special:Allpages|namespace=12&from={{PAGENAMEE}}}} gives here:

//en.wikipedia.org/w/index.php?title=Special:Allpages&namespace=12&from=Page_name

  • {{fullurl:Special:Allpages/{{PAGENAME}}|namespace=12}} gives here:

//en.wikipedia.org/w/index.php?title=Special:Allpages/Page_name&namespace=12

It is wrong to use::

  • {{fullurl:Special:Allpages|namespace=12&from={{PAGENAME}}}} gives here:

//en.wikipedia.org/w/index.php?title=Special:Allpages&namespace=12&from=Page name, which is the wrong link.

  • {{fullurl:Special:Allpages/{{PAGENAMEE}}|namespace=12}} gives here:

//en.wikipedia.org/w/index.php?title=Special:Allpages/Page_name&namespace=12 . It works here, as the underscore, converted from a space, is not affected by the second conversion; but it does not work with special characters.

See also

Notes

  1. ^ Per WikiMedia, (thus Wikipedia), "content" means it is in article namespace.
  2. ^ Pagename naming is different on other projects.
  3. ^ This is not true in all projects; for example, Wiktionary allows initial lower-case letters. This setting is configured using $wgCapitalLinks. Note that a title can be displayed with an initial lower-case letter, using DISPLAYTITLE, or the {{lowercase title}} template.
  4. ^ Note that the plus sign + is allowed in page titles, although in the default setup for MediaWiki it is not. This is configured by setting the value of $wgLegalTitleChars in LocalSettings.php.