Help:Namespace

Page titles in MediaWiki are composed of two parts: an optional namespace name, and the remainder of the title. For example, this page has the title : , so it is in the  namespace. A title without a colon, for example Goings-on, is in the main namespace.

Each wiki using the MediaWiki software has 16+2 namespaces: the main namespace, where page names have no prefix, 15 additional namespaces, each with its own prefix, and two virtual namespaces. In each project they are similar to the 18 explained in w:Wikipedia:Namespace for Wikipedia. One of these is the project namespace, which uses as prefix the project prefix (variable     below). Some projects have additional custom namespaces. For a list of all namespaces used on meta, see Namespaces.

Note: namespace prefixes should not be confused with prefixes for interwiki linking; see also Guide for system administrators for setting up interwiki linking.

If a page title contains a colon, but the initial part of the title is not one of the pre-defined namespaces, that page is considered to be in the main namespace.

Namespace uses
Namespaces among other things allow a separation of content from policy and discussion. They encourage separation of the pages of a wiki into a core set intended for public viewing, and private information intended for the editing community.

This core set is the main namespace. Other namespaces that are useful also for people who are just viewers are:
 * the image namespace (with the full-size images)
 * the category namespace (for navigation)
 * the help pages and the preferences page (as far as they concern viewing)

By default, searches and the random page feature are restricted to the main namespace, thus the user interface is directed towards readers who are not part of the community. Note that this separation of community and readership is not a feature of many wiki engines. It may not be required for your editing community. You are always free to put discussion and policy in the main namespace, if you desire.

On most Wikimedia wikis, pages in the main namespace and a few other ones are actively policed by the community, with inappropriate content being quickly removed. The rules for the other namespaces are generally more relaxed.


 * Special:Allpages can be applied to a namespace of choice


 * Searching can be restricted to any subset of namespaces

User contributions can only show all; not working anymore: or be restricted to a namespace of choice, see 2686.

It is possible to customise the visual appearance of pages by namespace; also enabling the subpage feature can be done for selected namespaces.

List of namespaces
The two virtual namespaces, main namespace and 15 auxiliary namespaces in this project (Meta) are as follows (the variables for them are also shown):

Note that all characters of namespace prefixes are case-insensitive, so one can write e.g "mediawiki".

The names are set in files such as those listed in Locales for the Wikimedia projects, with default Language.php:

/* private */ $wgNamespaceNamesEn = array(	NS_MEDIA           => 'Media',	NS_SPECIAL          => 'Special',	NS_MAIN	            => '',	NS_TALK	            => 'Talk',	NS_USER             => 'User',	NS_USER_TALK        => 'User_talk',	NS_WIKIPEDIA        => $wgMetaNamespace,	NS_WIKIPEDIA_TALK   => $wgMetaNamespace . '_talk',	NS_IMAGE            => 'Image',	NS_IMAGE_TALK       => 'Image_talk',	NS_MEDIAWIKI        => 'MediaWiki',	NS_MEDIAWIKI_TALK   => 'MediaWiki_talk',	NS_TEMPLATE         => 'Template',	NS_TEMPLATE_TALK    => 'Template_talk',	NS_HELP             => 'Help',	NS_HELP_TALK        => 'Help_talk',	NS_CATEGORY	    => 'Category',	NS_CATEGORY_TALK    => 'Category_talk' );

Automatic conversions of page names
On the column "Alternate syntax" in the table at the beginning of the previous section, a list of project-independent namespace names is shown in the form of    , the same as those on Meta and the English Wikipedia, except that "Meta" and "Wikipedia" are replaced by "Project". The prefixes are the terms listed, followed by a colon.

The prefix "Project:" is for every project automatically converted to the project namespace, e.g. try the link Project:xyz. It is like a piped link. Therefore a page name starting with "Project:" is not possible (unless, of course, that is the name of the project).

Similarly the other project-independent namespace prefixes are also automatically converted to the project-specific ones.

An exception to the rule that the link label is the name used in the wikitext and not the converted name, applies if the target of a redirect is expressed using a project-independent namespace name: in that case the converted name is shown on the redirect page, compare with the preview of.

Prefixes in various languages
For Wikimedia projects this project prefix is "Wikipedia:", "Wiktionary:", "Wikibooks:", "Wikisource:", "Wikiquote:", "Meta:", and in the case of In Memoriam also "Wikipedia:". In other languages than English, the Wikipedia project has its own prefixes: in French "Wikipédia:", in Czech "Wikipedie:", in Russian "Википедия:", in Korean "위키백과:", in Hindi "विकिपीडिया:", in Hebrew ":ויקיפדיה" and in Arabic ":ويكيبيديا". The last two are RTL languages which put the prefixes on the right. In URLs the prefixes are always on the left.

To check which prefix is used in a project, you may edit and preview a page in the project to render the variable     (and cancel the edit after the check), though what you will see is deprived of a colon. Another way: visiting any project page there, you will find it at the left (in LTR languages) or the right (in RTL languages) of the page title. This applies even for non-existing pages, so, in view of the conversion explained in the previous section, you can use a URL like http://ar.wikipedia.org/wiki/Project:A. Also you may go to a project page of a target language from a project page of a language familiar to you (e.g. en:Wikipedia:Contact us) by clicking an interlanguage link, if applicable. "Talk", "User", "Image" and combinations can also be translated in the case of non-English wikis. see Locales for the Wikipedia Software.

Colon in page name
Adding a colon to a page name does not automatically create a new namespace. To see the namespace of a page, use which returns the namespace. For this page it returns "". The same code would return an empty string for a page in the main namespace. Similarly, returns the page name without prefix. For this page it returns "".

To take some examples from Wiktionary: Wiktionary:FAQ has Talk page Wiktionary talk:FAQ, but Wiktionary Appendix:Colours has Talk page Talk:Wiktionary Appendix:Colours, because the first is in the project preface namespace and the second is not. In Special:Allpages, accordingly, the first is, unlike the second, not in the list of articles, but in the page list of the namespace Wiktionary. Unclear is why Wiktionary:Recentchanges is taken as an article.

Sites outside Wikimedia
Sites using MediaWiki but outside Wikimedia usually have their own project name as project prefix, but several have simply retained "Wikipedia:".

Interwiki linking is done with a prefix that is similar to namespaces.

Special namespace
Main article: Help:Special page

The namespace "Special:" consists of "special pages", which are created by the software on demand, for example Special:Recentchanges.

Custom namespaces
For instructions on creating a custom namespace or for more information, see Help:Custom_namespaces.

A project can have additional namespaces. For example, if a single project is multilingual (as opposed to the case of sister projects, each in one language) there may be a namespace Help: and also a namespace Hilfe:, for help pages in the English and German language, respectively.

Custom namespaces are numbered from 100.

For a full list of all namespaces in this project, see the search options of the preferences (Special:Preferences), or see the list in Special:Contributions/XX or Special:Allpages. In all cases they are in the order of ascending number, starting with 0 and without numbers 16-99.

The maximum number of namespaces is 256 (it is a TINYINT(2) in the SQL database), so custom namespace numbers are in the range 100-255. Hence there can be 156 of them, including talk pages, i.e. 78 custom namespaces and their talk namespaces.

The list of custom namespaces is $wgExtraNamespaces in LocalSettings.php.

Comparison of separate namespaces with separate projects
Compare, for example, having a separate projects in English and German, versus having a single project with separate namespaces for English: and Deutsch:


 * Srumberg

Largely disadvantageous aspects of separate projects

 * Not possible across projects:
 * existence detection of a linked page
 * related changes
 * what links here
 * use of templates
 * use of categories
 * message alert
 * user contributions can be shown separately or combined for namespaces within a project, but are always separate for separate projects
 * searching ditto

Largely advantageous aspects of separate projects

 * A link within a project does not require a prefix to specify that project, a link within a non-main namespace does require the namespace prefix.

Differences that can be advantages or disadvantages
Separate per project are:
 * Recent changes
 * Preferences, status such as sysop
 * Watchlist

Tab labels
The first tab shows the namespace. See the link, if it is there, to see what it is in this project. For Meta-Wikipedia it is as shown on the right.


 * category: mediawiki:nstab-category => ""
 * help: 'nstab-help' => "Help",
 * image: 'nstab-image' => "Image",
 * main: 'nstab-main' => "content page",
 * mediawiki: 'nstab-mediawiki' => "Message",
 * project: 'nstab-wp' => "About",
 * template: 'nstab-template' => "Template",
 * user: 'nstab-user' => "User page",

The second tab, linking to the talk page:


 * Talk: 'talk' => "Discussion"

On a diff page or a page with an old version, the links are to the current version (however, the edit tab on a page with an old version links to the edit page of that old version; this does not apply on a diff page comparing two old versions, there the edit tab links to the edit page for the current version).

The self link feature (a self link appearing as bold text) does not work for the tabs, no distinction is shown between a self link and a link to a different (version of a) page.

With the class "selected" one can let the tab for the same namespace as the current page (either a self link or a link to the current revison) be displayed differently; also the tabs "edit" and "history" are then displayed in this different way when applicable.