Jump to navigation Jump to search
Translate this page; This page contains changes which are not marked for translation.

Other languages:
English • ‎español • ‎français • ‎polski • ‎português do Brasil • ‎中文 • ‎日本語
Namespaces: $wgNamespacesWithSubpages
Which namespaces should support subpages?
Introduced in version:pre 1.1.0
Removed in version:still in use
Allowed values:see below
Default value:see below
Other settings: Alphabetical | By function


The variable holds an array indicating which namespaces allow sub-pages. The array is indexed by the numeric namespace ID, and each array value is either 0 (no sub-pages) or 1 (sub-pages allowed). A categoryspace (namespace 14) subpage will work like any other category.

See Help:SubpagesHelp:Subpages.

Enabling for a namespace[edit]

See also Manual:Namespace constantsManual:Namespace constants for a list of the NS_... codes.

The normal way to enable subpages for a given namespace is to edit the LocalSettings.phpManual:LocalSettings.php and insert the following:

# Enable subpages in the main namespace
$wgNamespacesWithSubpages[NS_MAIN] = true;

# Enable subpages in the template namespace
$wgNamespacesWithSubpages[NS_TEMPLATE] = true;

# etc.

Disabling for a namespace[edit]

Disable subpages in a namespace (where it is enabled by default). For example NS_TALK has subpages enabled by default in MediaWiki. To disable them, set false:

$wgNamespacesWithSubpages[NS_TALK] = false;

Default value[edit]

$wgNamespacesWithSubpages = [
	NS_TALK => true,
	NS_USER => true,
	NS_USER_TALK => true,
	NS_PROJECT => true,
	NS_FILE_TALK => true,
	NS_MEDIAWIKI => true,
	NS_TEMPLATE => true,
	NS_HELP => true,
	NS_HELP_TALK => true,
The default of this setting has changed over the years. To be sure which one applies to your wiki check this setting in "DefaultSettings.php".

See also[edit]