From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manual
Crystal Clear action run.png

Release status: unmaintained

Implementation Parser function, MyWiki
Description Hides namespace in the header and title when a page is in specified namespace or when the {{#hidens:}} parser function is called. You can also use {{#showns:}} to override the visibility individually.
Author(s) Matěj Grabovskýtalk
Latest version 1.4.3 (2010-12-31)
MediaWiki 1.15 or later
License GNU General Public License 2.0 or later
Download Template:WikimediaDownload/svn


Hooks used


Translate the HideNamespace extension if it is available at translatewiki.net

Check usage and version matrix; code metrics

The HideNamespace extension allows to hide namespace name in page title and its header.

Usage[edit | edit source]

This extension has two main functionalities. They're both explained in the following sections.

The $wgHidensNamespaces array[edit | edit source]

Warning Warning:

The first option is to use global variable $wgHidensNamespaces. By specifying namespaces in the $wgHidensNamespaces array you can hide the namespace prefix in all pages within the namespaces.

Example (put in LocalSettings.php after including the extension file):

$wgHidensNamespaces = array(

This would hide the namespace prefix in all pages within the “File”, “User”, and “User talk” namespaces. Thus if there's a user page with name “User:Foo Bar”, it'd become “Foo Bar” when you visit the page.

Parser functions[edit | edit source]

The second option is to hide/unhide namespaces with two parser functions: {{#hidens:}} and {{#showns:}}. Those two parser functions don't take any parameters.


Foo bar. Baz, 1926.

If the previous page would be called, for instance, “Help:Bark”, it would become just “Bark” when you visit the page.

Other example:

Hello, my name's Joe. You can leave me a message on my talk page.

If we would define the $wgHidensNamespaces variable as in the very first example and the previous page would be called “User:Joe Doe”, the page title would still be “User:Joe Doe” when you visit the page, because you've overriden the setting with the {{#showns:}} parser function.

Installation[edit | edit source]

  • Copy the code into files and place the file(s) in a directory called HideNamespace in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php:
require_once "$IP/extensions/HideNamespace/HideNamespace.php";
$wgHidensNamespaces = array();
  • YesY Done - Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

See also[edit | edit source]