From mediawiki.org
Jump to navigation Jump to search
MediaWiki extensions manual
OOjs UI icon advanced.svg
Release status: unmaintained
Implementation Tag
Description Allows raw HTML & PHP include in specified namespaces
Author(s) Ike Hecht, modified by François Zajéga (frankiezafetalk)
Latest version 0.2 (January 2016)
MediaWiki 1.23+, likely earlier versions as well
PHP 5.3+
Database changes No
License GNU General Public License 2.0 or later
Download NamespaceHTMLSCRIPT on bitbucket
<html>, <script>

Check usage and version matrix.

The NamespaceHTMLSCRIPT extension allows raw HTML & PHP includes in specified namespaces. It is based on the NamespaceHTML extension.

This extension allows editors to add plain PHP calls in content! Use carefully!


  • Embed raw html within <html>...</html> tags. See this page for more information.
  • Embed php code within <script>...</script> tags.

<script> echo "NamespaceHTMLSCRIPT is activated"; </script>


  • Download and place the file(s) in a directory called NamespaceHTMLSCRIPT in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php:
    require_once "$IP/extensions/NamespaceHTMLSCRIPT/NamespaceHTMLSCRIPT.php";
  • Configure as required.

Note Note: $wgRawHtmlScriptNamespaces= array(); must be set!

  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.tt


An array of namespaces where raw HTML should be enabled. See this page for more information about namespace constants. For example:
$wgRawHtmlScriptNamespaces = array( NS_PROJECT ); # allow raw HTML but only in the Project namespace


  • Convert PHP output to HTML on save.
  • Disable tag depending on usergroups

See also[edit]