HTML restriction - MediaWiki (2024)

MediaWiki restricts the use of HTML by default.Only some HTML elements and attributes are allowed.Raw-HTML sections, surrounded by the "html" tag, can be enabled with the configuration parameter $wgRawHtml.The code is available at includes/parser/Sanitizer.php.

Wikimedia websites (see complete list here) do not allow full use of HTML.A request to allow full use of HTML was rejected in 2005.

There are several extensions that allow for the inclusion of raw HTML.Here are the extensions that appear to be safe:

  • Extension:HTMLets (unmaintained) – allows pre-defined HTML snippets with $wgRawHtml = false;
  • Extension:HTML Tags (stable) – allows for adding HTML from a set of tags and attributes defined in the wiki's settings
  • Extension:Secure HTML (unmaintained) – adds 'Secret key' protection for html sections
  • Extension:SaferHTMLTag (beta) – prevents edition of pages that contain the ‎‎<html> tag by unauthorized users and groups
  • Extension:HTMLPurifier (beta) – allows users to input raw HTML by using HTML Purifier to sanitize it
  • Extension:NamespaceHTML (unmaintained, has known security vulnerability) – allows raw HTML in specified namespaces
  • Extension:Widgets (stable) – allows for defining HTML- and JavaScript-based "widgets", with optional parameters
HTML restriction - MediaWiki (2024)
Top Articles
Latest Posts
Article information

Author: Rubie Ullrich

Last Updated:

Views: 6344

Rating: 4.1 / 5 (72 voted)

Reviews: 87% of readers found this page helpful

Author information

Name: Rubie Ullrich

Birthday: 1998-02-02

Address: 743 Stoltenberg Center, Genovevaville, NJ 59925-3119

Phone: +2202978377583

Job: Administration Engineer

Hobby: Surfing, Sailing, Listening to music, Web surfing, Kitesurfing, Geocaching, Backpacking

Introduction: My name is Rubie Ullrich, I am a enthusiastic, perfect, tender, vivacious, talented, famous, delightful person who loves writing and wants to share my knowledge and understanding with you.