From mediawiki.org
Jump to navigation Jump to search
MediaWiki extensions manual
OOjs UI icon advanced.svg
Release status: stable
Implementation Tag
Description Allows raw HTML in specified namespaces
Author(s) Ike Hecht (tosfostalk)
Maintainer(s) WikiTeq team
Latest version 0.4 (4 January 2021(2021-01-04))
MediaWiki 1.35+
Database changes No
License GNU General Public License 2.0 or later
Translate the NamespaceHTML extension if it is available at translatewiki.net

Check usage and version matrix.

The NamespaceHTML extension allows raw HTML in specified namespaces. It is intended to work just like the $wgRawHtml setting. The difference is that this extension allows specifying which namespace(s) should be able to contain raw HTML, which allows administrators to restrict raw HTML to namespaces with sufficient edit protections.

This extension was created for WikiWorks.


Embed raw html within <html>...</html> tags. See this page for more information.

As a template[edit]

The extension allows inclusion from namespaces where HTML is allowed to namespaces where HTML is not. You can create a custom script namespace and allow HTML in that namespace. Then you can create pages in the script namespace that contain safe scripts which can be transcluded into any page.

Technically, you can use the #tag parser function to pass parameters to the template. See here for an example. However, it is a better idea to use the Widgets extension for that.

Widget examples[edit]


  • Download and place the file(s) in a directory called NamespaceHTML in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php:
    wfLoadExtension( 'NamespaceHTML' );
  • Configure as required.
  • Note Note: $wgRawHtmlNamespaces = []; must be configured, see below.
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.


List of the namespaces where raw HTML should be enabled. See this page for more information about namespace constants. For example:
# allow raw HTML but only in the Project: & User: namespaces
$wgRawHtmlNamespaces = [ NS_PROJECT, NS_USER ];

See also[edit]

Wikiteq - logo.png This extension is professionally maintained by the WikiTeq team.