CINXE.COM
Manual:Special pages - MediaWiki
<!DOCTYPE html> <html class="client-nojs vector-feature-language-in-header-disabled vector-feature-language-in-main-page-header-disabled vector-feature-sticky-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref--excluded vector-feature-appearance-pinned-clientpref-1 vector-feature-night-mode-disabled skin-theme-clientpref-day vector-toc-available" lang="en" dir="ltr"> <head> <meta charset="UTF-8"> <title>Manual:Special pages - MediaWiki</title> <script>(function(){var className="client-js vector-feature-language-in-header-disabled vector-feature-language-in-main-page-header-disabled vector-feature-sticky-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref--excluded vector-feature-appearance-pinned-clientpref-1 vector-feature-night-mode-disabled skin-theme-clientpref-day vector-toc-available";var cookie=document.cookie.match(/(?:^|; )mediawikiwikimwclientpreferences=([^;]+)/);if(cookie){cookie[1].split('%2C').forEach(function(pref){className=className.replace(new RegExp('(^| )'+pref.replace(/-clientpref-\w+$|[^\w-]+/g,'')+'-clientpref-\\w+( |$)'),'$1'+pref+'$2');});}document.documentElement.className=className;}());RLCONF={"wgBreakFrames":false,"wgSeparatorTransformTable":["",""],"wgDigitTransformTable":["",""], "wgDefaultDateFormat":"dmy","wgMonthNames":["","January","February","March","April","May","June","July","August","September","October","November","December"],"wgRequestId":"f623f7c4-c594-45f5-9ea6-1afa9b89c27f","wgCanonicalNamespace":"Manual","wgCanonicalSpecialPageName":false,"wgNamespaceNumber":100,"wgPageName":"Manual:Special_pages","wgTitle":"Special pages","wgCurRevisionId":6804659,"wgRevisionId":6804659,"wgArticleId":15999,"wgIsArticle":true,"wgIsRedirect":false,"wgAction":"view","wgUserName":null,"wgUserGroups":["*"],"wgCategories":["MediaWiki development","Customization techniques","User interface","Special Pages"],"wgPageViewLanguage":"en","wgPageContentLanguage":"en","wgPageContentModel":"wikitext","wgRelevantPageName":"Manual:Special_pages","wgRelevantArticleId":15999,"wgIsProbablyEditable":false,"wgRelevantPageIsProbablyEditable":false,"wgRestrictionEdit":["autoconfirmed"],"wgRestrictionMove":["autoconfirmed"],"wgNoticeProject":"mediawiki","wgCiteReferencePreviewsActive": true,"wgMediaViewerOnClick":true,"wgMediaViewerEnabledByDefault":true,"wgVisualEditor":{"pageLanguageCode":"en","pageLanguageDir":"ltr","pageVariantFallbacks":"en"},"wgMFDisplayWikibaseDescriptions":{"search":true,"watchlist":true,"tagline":false,"nearby":true},"wgWMESchemaEditAttemptStepOversample":false,"wgWMEPageLength":50000,"wgInternalRedirectTargetUrl":"/wiki/Manual:Special_pages","wgTranslatePageTranslation":"source","wgEditSubmitButtonLabelPublish":true,"wgULSPosition":"personal","wgULSisCompactLinksEnabled":true,"wgVector2022LanguageInHeader":false,"wgULSisLanguageSelectorEmpty":false,"wgWikibaseItemId":"Q119512495","wgCheckUserClientHintsHeadersJsApi":["brands","architecture","bitness","fullVersionList","mobile","model","platform","platformVersion"],"wgSiteNoticeId":"2.7"};RLSTATE={"ext.globalCssJs.user.styles":"ready","site.styles":"ready","user.styles":"ready","ext.globalCssJs.user":"ready","user":"ready","user.options":"loading","ext.translate.tag.languages":"ready", "ext.pygments":"ready","skins.vector.search.codex.styles":"ready","skins.vector.styles":"ready","skins.vector.icons":"ready","ext.translate.edit.documentation.styles":"ready","ext.translate":"ready","ext.wikimediamessages.styles":"ready","ext.visualEditor.desktopArticleTarget.noscript":"ready","ext.uls.pt":"ready","wikibase.client.init":"ready","ext.wikimediaBadges":"ready","ext.dismissableSiteNotice.styles":"ready"};RLPAGEMODULES=["mediawiki.action.view.redirect","ext.pygments.view","site","mediawiki.page.ready","mediawiki.toc","skins.vector.js","ext.centralNotice.geoIP","ext.centralNotice.startUp","ext.translate.pagetranslation.uls","ext.urlShortener.toolbar","ext.centralauth.centralautologin","mmv.bootstrap","ext.visualEditor.desktopArticleTarget.init","ext.visualEditor.targetLoader","ext.echo.centralauth","ext.eventLogging","ext.wikimediaEvents","ext.navigationTiming","ext.uls.compactlinks","ext.uls.interface","wikibase.client.vector-2022","ext.checkUser.clientHints", "ext.dismissableSiteNotice"];</script> <script>(RLQ=window.RLQ||[]).push(function(){mw.loader.impl(function(){return["user.options@12s5i",function($,jQuery,require,module){mw.user.tokens.set({"patrolToken":"+\\","watchToken":"+\\","csrfToken":"+\\"}); }];});});</script> <link rel="stylesheet" href="/w/load.php?lang=en&modules=ext.dismissableSiteNotice.styles%7Cext.pygments%2Ctranslate%2CwikimediaBadges%7Cext.translate.edit.documentation.styles%7Cext.translate.tag.languages%7Cext.uls.pt%7Cext.visualEditor.desktopArticleTarget.noscript%7Cext.wikimediamessages.styles%7Cskins.vector.icons%2Cstyles%7Cskins.vector.search.codex.styles%7Cwikibase.client.init&only=styles&skin=vector-2022"> <script async="" src="/w/load.php?lang=en&modules=startup&only=scripts&raw=1&skin=vector-2022"></script> <meta name="ResourceLoaderDynamicStyles" content=""> <link rel="stylesheet" href="/w/load.php?lang=en&modules=site.styles&only=styles&skin=vector-2022"> <meta name="generator" content="MediaWiki 1.44.0-wmf.8"> <meta name="referrer" content="origin"> <meta name="referrer" content="origin-when-cross-origin"> <meta name="robots" content="max-image-preview:standard"> <meta name="format-detection" content="telephone=no"> <meta name="viewport" content="width=1120"> <meta property="og:site_name" content="MediaWiki"> <meta property="og:title" content="Manual:Special pages - MediaWiki"> <meta property="og:type" content="website"> <link rel="preconnect" href="//upload.wikimedia.org"> <link rel="alternate" media="only screen and (max-width: 640px)" href="//m.mediawiki.org/wiki/Manual:Special_pages"> <link rel="apple-touch-icon" href="/static/apple-touch/mediawiki.png"> <link rel="icon" href="/static/favicon/mediawiki.ico"> <link rel="search" type="application/opensearchdescription+xml" href="/w/rest.php/v1/search" title="MediaWiki (en)"> <link rel="EditURI" type="application/rsd+xml" href="//www.mediawiki.org/w/api.php?action=rsd"> <link rel="canonical" href="https://www.mediawiki.org/wiki/Manual:Special_pages"> <link rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/"> <link rel="alternate" type="application/atom+xml" title="MediaWiki Atom feed" href="/w/index.php?title=Special:RecentChanges&feed=atom"> <link rel="dns-prefetch" href="//meta.wikimedia.org" /> <link rel="dns-prefetch" href="login.wikimedia.org"> </head> <body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-100 ns-subject page-Manual_Special_pages rootpage-Manual_Special_pages skin-vector-2022 action-view"><a class="mw-jump-link" href="#bodyContent">Jump to content</a> <div class="vector-header-container"> <header class="vector-header mw-header"> <div class="vector-header-start"> <nav class="vector-main-menu-landmark" aria-label="Site"> <div id="vector-main-menu-dropdown" class="vector-dropdown vector-main-menu-dropdown vector-button-flush-left vector-button-flush-right" > <input type="checkbox" id="vector-main-menu-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-main-menu-dropdown" class="vector-dropdown-checkbox " aria-label="Main menu" > <label id="vector-main-menu-dropdown-label" for="vector-main-menu-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-menu mw-ui-icon-wikimedia-menu"></span> <span class="vector-dropdown-label-text">Main menu</span> </label> <div class="vector-dropdown-content"> <div id="vector-main-menu-unpinned-container" class="vector-unpinned-container"> <div id="vector-main-menu" class="vector-main-menu vector-pinnable-element"> <div class="vector-pinnable-header vector-main-menu-pinnable-header vector-pinnable-header-unpinned" data-feature-name="main-menu-pinned" data-pinnable-element-id="vector-main-menu" data-pinned-container-id="vector-main-menu-pinned-container" data-unpinned-container-id="vector-main-menu-unpinned-container" > <div class="vector-pinnable-header-label">Main menu</div> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-main-menu.pin">move to sidebar</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-main-menu.unpin">hide</button> </div> <div id="p-navigation" class="vector-menu mw-portlet mw-portlet-navigation" > <div class="vector-menu-heading"> Navigation </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="n-mainpage-description" class="mw-list-item"><a href="/wiki/MediaWiki" title="Visit the main page [z]" accesskey="z"><span>Main page</span></a></li><li id="n-mw-download" class="mw-list-item"><a href="/wiki/Download"><span>Get MediaWiki</span></a></li><li id="n-mw-extensions" class="mw-list-item"><a href="/wiki/Special:MyLanguage/Category:Extensions"><span>Get extensions</span></a></li><li id="n-blog-text" class="mw-list-item"><a href="https://techblog.wikimedia.org/"><span>Tech blog</span></a></li><li id="n-mw-contribute" class="mw-list-item"><a href="/wiki/Special:MyLanguage/How_to_contribute"><span>Contribute</span></a></li> </ul> </div> </div> <div id="p-support" class="vector-menu mw-portlet mw-portlet-support" > <div class="vector-menu-heading"> Support </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="n-help" class="mw-list-item"><a href="/wiki/Special:MyLanguage/Help:Contents" title="The place to find out"><span>User help</span></a></li><li id="n-mw-faq" class="mw-list-item"><a href="/wiki/Special:MyLanguage/Manual:FAQ"><span>FAQ</span></a></li><li id="n-mw-manual" class="mw-list-item"><a href="/wiki/Special:MyLanguage/Manual:Contents"><span>Technical manual</span></a></li><li id="n-mw-supportdesk" class="mw-list-item"><a href="/wiki/Project:Support_desk"><span>Support desk</span></a></li><li id="n-mw-communication" class="mw-list-item"><a href="/wiki/Special:MyLanguage/Communication"><span>Communication</span></a></li> </ul> </div> </div> <div id="p-development" class="vector-menu mw-portlet mw-portlet-development" > <div class="vector-menu-heading"> Development </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="n-mw-developerportal" class="mw-list-item"><a href="https://developer.wikimedia.org/"><span>Developer portal</span></a></li><li id="n-svn-statistics" class="mw-list-item"><a href="/wiki/Development_statistics"><span>Code statistics</span></a></li> </ul> </div> </div> <div id="p-mediawiki.org" class="vector-menu mw-portlet mw-portlet-mediawiki_org" > <div class="vector-menu-heading"> mediawiki.org </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="n-portal" class="mw-list-item"><a href="/wiki/Project:Help" title="About the project, what you can do, where to find things"><span>Community portal</span></a></li><li id="n-recentchanges" class="mw-list-item"><a href="/wiki/Special:RecentChanges" title="A list of recent changes in the wiki [r]" accesskey="r"><span>Recent changes</span></a></li><li id="n-mw-translate" class="mw-list-item"><a href="/wiki/Special:LanguageStats"><span>Translate content</span></a></li><li id="n-randompage" class="mw-list-item"><a href="/wiki/Special:Random" title="Load a random page [x]" accesskey="x"><span>Random page</span></a></li><li id="n-mw-discussion" class="mw-list-item"><a href="/wiki/Project:Village_Pump"><span>Village pump</span></a></li><li id="n-Sandboxlink-portlet-label" class="mw-list-item"><a href="/wiki/Project:Sandbox"><span>Sandbox</span></a></li> </ul> </div> </div> <div id="p-lang" class="vector-menu mw-portlet mw-portlet-lang" > <div class="vector-menu-heading"> In other languages </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> <div class="after-portlet after-portlet-lang"><span class="wb-langlinks-add wb-langlinks-link"><a href="https://www.wikidata.org/wiki/Special:EntityPage/Q119512495#sitelinks-wikipedia" title="Add interlanguage links" class="wbc-editpage">Add links</a></span></div> </div> </div> </div> </div> </div> </div> </nav> <a href="/wiki/MediaWiki" class="mw-logo"> <img class="mw-logo-icon" src="/static/images/icons/mediawikiwiki.svg" alt="" aria-hidden="true" height="50" width="50"> <span class="mw-logo-container skin-invert"> <img class="mw-logo-wordmark" alt="MediaWiki" src="/static/images/mobile/copyright/mediawikiwiki-wordmark.svg" style="width: 7.5em; height: 1.125em;"> </span> </a> </div> <div class="vector-header-end"> <div id="p-search" role="search" class="vector-search-box-vue vector-search-box-collapses vector-search-box-show-thumbnail vector-search-box-auto-expand-width vector-search-box"> <a href="/wiki/Special:Search" class="cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only search-toggle" title="Search MediaWiki [f]" accesskey="f"><span class="vector-icon mw-ui-icon-search mw-ui-icon-wikimedia-search"></span> <span>Search</span> </a> <div class="vector-typeahead-search-container"> <div class="cdx-typeahead-search cdx-typeahead-search--show-thumbnail cdx-typeahead-search--auto-expand-width"> <form action="/w/index.php" id="searchform" class="cdx-search-input cdx-search-input--has-end-button"> <div id="simpleSearch" class="cdx-search-input__input-wrapper" data-search-loc="header-moved"> <div class="cdx-text-input cdx-text-input--has-start-icon"> <input class="cdx-text-input__input" type="search" name="search" placeholder="Search MediaWiki" aria-label="Search MediaWiki" autocapitalize="sentences" title="Search MediaWiki [f]" accesskey="f" id="searchInput" > <span class="cdx-text-input__icon cdx-text-input__start-icon"></span> </div> <input type="hidden" name="title" value="Special:Search"> </div> <button class="cdx-button cdx-search-input__end-button">Search</button> </form> </div> </div> </div> <nav class="vector-user-links vector-user-links-wide" aria-label="Personal tools"> <div class="vector-user-links-main"> <div id="p-vector-user-menu-preferences" class="vector-menu mw-portlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-uls" class="mw-list-item active user-links-collapsible-item"><a data-mw="interface" href="#" class="uls-trigger cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet"><span class="vector-icon mw-ui-icon-wikimedia-language mw-ui-icon-wikimedia-wikimedia-language"></span> <span>English</span></a> </li> </ul> </div> </div> <div id="p-vector-user-menu-userpage" class="vector-menu mw-portlet emptyPortlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> <nav class="vector-appearance-landmark" aria-label="Appearance"> <div id="vector-appearance-dropdown" class="vector-dropdown " title="Change the appearance of the page's font size, width, and color" > <input type="checkbox" id="vector-appearance-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-appearance-dropdown" class="vector-dropdown-checkbox " aria-label="Appearance" > <label id="vector-appearance-dropdown-label" for="vector-appearance-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-appearance mw-ui-icon-wikimedia-appearance"></span> <span class="vector-dropdown-label-text">Appearance</span> </label> <div class="vector-dropdown-content"> <div id="vector-appearance-unpinned-container" class="vector-unpinned-container"> </div> </div> </div> </nav> <div id="p-vector-user-menu-notifications" class="vector-menu mw-portlet emptyPortlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> <div id="p-vector-user-menu-overflow" class="vector-menu mw-portlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="pt-sitesupport-2" class="user-links-collapsible-item mw-list-item user-links-collapsible-item"><a data-mw="interface" href="https://donate.wikimedia.org/?wmf_source=donate&wmf_medium=sidebar&wmf_campaign=www.mediawiki.org&uselang=en" class=""><span>Donate</span></a> </li> <li id="pt-createaccount-2" class="user-links-collapsible-item mw-list-item user-links-collapsible-item"><a data-mw="interface" href="/w/index.php?title=Special:CreateAccount&returnto=Manual%3ASpecial+pages" title="You are encouraged to create an account and log in; however, it is not mandatory" class=""><span>Create account</span></a> </li> <li id="pt-login-2" class="user-links-collapsible-item mw-list-item user-links-collapsible-item"><a data-mw="interface" href="/w/index.php?title=Special:UserLogin&returnto=Manual%3ASpecial+pages" title="You are encouraged to log in; however, it is not mandatory [o]" accesskey="o" class=""><span>Log in</span></a> </li> </ul> </div> </div> </div> <div id="vector-user-links-dropdown" class="vector-dropdown vector-user-menu vector-button-flush-right vector-user-menu-logged-out" title="More options" > <input type="checkbox" id="vector-user-links-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-user-links-dropdown" class="vector-dropdown-checkbox " aria-label="Personal tools" > <label id="vector-user-links-dropdown-label" for="vector-user-links-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-ellipsis mw-ui-icon-wikimedia-ellipsis"></span> <span class="vector-dropdown-label-text">Personal tools</span> </label> <div class="vector-dropdown-content"> <div id="p-personal" class="vector-menu mw-portlet mw-portlet-personal user-links-collapsible-item" title="User menu" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="pt-sitesupport" class="user-links-collapsible-item mw-list-item"><a href="https://donate.wikimedia.org/?wmf_source=donate&wmf_medium=sidebar&wmf_campaign=www.mediawiki.org&uselang=en"><span>Donate</span></a></li><li id="pt-createaccount" class="user-links-collapsible-item mw-list-item"><a href="/w/index.php?title=Special:CreateAccount&returnto=Manual%3ASpecial+pages" title="You are encouraged to create an account and log in; however, it is not mandatory"><span class="vector-icon mw-ui-icon-userAdd mw-ui-icon-wikimedia-userAdd"></span> <span>Create account</span></a></li><li id="pt-login" class="user-links-collapsible-item mw-list-item"><a href="/w/index.php?title=Special:UserLogin&returnto=Manual%3ASpecial+pages" title="You are encouraged to log in; however, it is not mandatory [o]" accesskey="o"><span class="vector-icon mw-ui-icon-logIn mw-ui-icon-wikimedia-logIn"></span> <span>Log in</span></a></li> </ul> </div> </div> <div id="p-user-menu-anon-editor" class="vector-menu mw-portlet mw-portlet-user-menu-anon-editor" > <div class="vector-menu-heading"> Pages for logged out editors <a href="/wiki/Help:Introduction" aria-label="Learn more about editing"><span>learn more</span></a> </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="pt-anoncontribs" class="mw-list-item"><a href="/wiki/Special:MyContributions" title="A list of edits made from this IP address [y]" accesskey="y"><span>Contributions</span></a></li><li id="pt-anontalk" class="mw-list-item"><a href="/wiki/Special:MyTalk" title="Discussion about edits from this IP address [n]" accesskey="n"><span>Talk</span></a></li> </ul> </div> </div> </div> </div> </nav> </div> </header> </div> <div class="mw-page-container"> <div class="mw-page-container-inner"> <div class="vector-sitenotice-container"> <div id="siteNotice"><div id="mw-dismissablenotice-anonplace"></div><script>(function(){var node=document.getElementById("mw-dismissablenotice-anonplace");if(node){node.outerHTML="\u003Cdiv class=\"mw-dismissable-notice\"\u003E\u003Cdiv class=\"mw-dismissable-notice-close\"\u003E[\u003Ca tabindex=\"0\" role=\"button\"\u003Edismiss\u003C/a\u003E]\u003C/div\u003E\u003Cdiv class=\"mw-dismissable-notice-body\"\u003E\u003C!-- CentralNotice --\u003E\u003Cdiv id=\"localNotice\" data-nosnippet=\"\"\u003E\u003Cdiv class=\"sitenotice\" lang=\"en\" dir=\"ltr\"\u003E\u003Ccenter\u003E\n\u003Cdiv style=\"width:100%;border-style:solid; border-width:2px; border-color:var(--color-placeholder, black); text-align:center; padding: 6px;\"\u003E🗳️🖥️ The Wikimedia Foundation \u003Ca href=\"/wiki/Special:MyLanguage/Developer_Satisfaction_Survey/December_2024/announcement\" title=\"Special:MyLanguage/Developer Satisfaction Survey/December 2024/announcement\"\u003EDecember 2024 Developer Satisfaction Survey\u003C/a\u003E is now live.\nThis survey is used to measure developer satisfaction, \u0026amp; determine where to invest resources in the future.\u003C/div\u003E\n\u003C/center\u003E\u003C/div\u003E\u003C/div\u003E\u003C/div\u003E\u003C/div\u003E";}}());</script></div> </div> <div class="vector-column-start"> <div class="vector-main-menu-container"> <div id="mw-navigation"> <nav id="mw-panel" class="vector-main-menu-landmark" aria-label="Site"> <div id="vector-main-menu-pinned-container" class="vector-pinned-container"> </div> </nav> </div> </div> <div class="vector-sticky-pinned-container"> <nav id="mw-panel-toc" aria-label="Contents" data-event-name="ui.sidebar-toc" class="mw-table-of-contents-container vector-toc-landmark"> <div id="vector-toc-pinned-container" class="vector-pinned-container"> <div id="vector-toc" class="vector-toc vector-pinnable-element"> <div class="vector-pinnable-header vector-toc-pinnable-header vector-pinnable-header-pinned" data-feature-name="toc-pinned" data-pinnable-element-id="vector-toc" > <h2 class="vector-pinnable-header-label">Contents</h2> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-toc.pin">move to sidebar</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-toc.unpin">hide</button> </div> <ul class="vector-toc-contents" id="mw-panel-toc-list"> <li id="toc-mw-content-text" class="vector-toc-list-item vector-toc-level-1"> <a href="#" class="vector-toc-link"> <div class="vector-toc-text">Beginning</div> </a> </li> <li id="toc-General_Information" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#General_Information"> <div class="vector-toc-text"> <span class="vector-toc-numb">1</span> <span>General Information</span> </div> </a> <ul id="toc-General_Information-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Basic_special_page_template" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#Basic_special_page_template"> <div class="vector-toc-text"> <span class="vector-toc-numb">2</span> <span>Basic special page template</span> </div> </a> <button aria-controls="toc-Basic_special_page_template-sublist" class="cdx-button cdx-button--weight-quiet cdx-button--icon-only vector-toc-toggle"> <span class="vector-icon mw-ui-icon-wikimedia-expand"></span> <span>Toggle Basic special page template subsection</span> </button> <ul id="toc-Basic_special_page_template-sublist" class="vector-toc-list"> <li id="toc-The_setup_file" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#The_setup_file"> <div class="vector-toc-text"> <span class="vector-toc-numb">2.1</span> <span>The setup file</span> </div> </a> <ul id="toc-The_setup_file-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-The_special_page_file" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#The_special_page_file"> <div class="vector-toc-text"> <span class="vector-toc-numb">2.2</span> <span>The special page file</span> </div> </a> <ul id="toc-The_special_page_file-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-The_localisation_file" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#The_localisation_file"> <div class="vector-toc-text"> <span class="vector-toc-numb">2.3</span> <span>The localisation file</span> </div> </a> <ul id="toc-The_localisation_file-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-The_aliases_file" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#The_aliases_file"> <div class="vector-toc-text"> <span class="vector-toc-numb">2.4</span> <span>The aliases file</span> </div> </a> <ul id="toc-The_aliases_file-sublist" class="vector-toc-list"> <li id="toc-Special_page_group" class="vector-toc-list-item vector-toc-level-3"> <a class="vector-toc-link" href="#Special_page_group"> <div class="vector-toc-text"> <span class="vector-toc-numb">2.4.1</span> <span>Special page group</span> </div> </a> <ul id="toc-Special_page_group-sublist" class="vector-toc-list"> </ul> </li> </ul> </li> </ul> </li> <li id="toc-Other_Important_Files" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#Other_Important_Files"> <div class="vector-toc-text"> <span class="vector-toc-numb">3</span> <span>Other Important Files</span> </div> </a> <button aria-controls="toc-Other_Important_Files-sublist" class="cdx-button cdx-button--weight-quiet cdx-button--icon-only vector-toc-toggle"> <span class="vector-icon mw-ui-icon-wikimedia-expand"></span> <span>Toggle Other Important Files subsection</span> </button> <ul id="toc-Other_Important_Files-sublist" class="vector-toc-list"> <li id="toc-SpecialPage.php" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#SpecialPage.php"> <div class="vector-toc-text"> <span class="vector-toc-numb">3.1</span> <span>SpecialPage.php</span> </div> </a> <ul id="toc-SpecialPage.php-sublist" class="vector-toc-list"> <li id="toc-Constructor" class="vector-toc-list-item vector-toc-level-3"> <a class="vector-toc-link" href="#Constructor"> <div class="vector-toc-text"> <span class="vector-toc-numb">3.1.1</span> <span>Constructor</span> </div> </a> <ul id="toc-Constructor-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-SpecialPage->setHeaders()" class="vector-toc-list-item vector-toc-level-3"> <a class="vector-toc-link" href="#SpecialPage->setHeaders()"> <div class="vector-toc-text"> <span class="vector-toc-numb">3.1.2</span> <span>SpecialPage->setHeaders()</span> </div> </a> <ul id="toc-SpecialPage->setHeaders()-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-SpecialPage->getOutput()" class="vector-toc-list-item vector-toc-level-3"> <a class="vector-toc-link" href="#SpecialPage->getOutput()"> <div class="vector-toc-text"> <span class="vector-toc-numb">3.1.3</span> <span>SpecialPage->getOutput()</span> </div> </a> <ul id="toc-SpecialPage->getOutput()-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-SpecialPage->getRequest()" class="vector-toc-list-item vector-toc-level-3"> <a class="vector-toc-link" href="#SpecialPage->getRequest()"> <div class="vector-toc-text"> <span class="vector-toc-numb">3.1.4</span> <span>SpecialPage->getRequest()</span> </div> </a> <ul id="toc-SpecialPage->getRequest()-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-SpecialPage->including()" class="vector-toc-list-item vector-toc-level-3"> <a class="vector-toc-link" href="#SpecialPage->including()"> <div class="vector-toc-text"> <span class="vector-toc-numb">3.1.5</span> <span>SpecialPage->including()</span> </div> </a> <ul id="toc-SpecialPage->including()-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-SpecialPage->execute()" class="vector-toc-list-item vector-toc-level-3"> <a class="vector-toc-link" href="#SpecialPage->execute()"> <div class="vector-toc-text"> <span class="vector-toc-numb">3.1.6</span> <span>SpecialPage->execute()</span> </div> </a> <ul id="toc-SpecialPage->execute()-sublist" class="vector-toc-list"> <li id="toc-Help_page" class="vector-toc-list-item vector-toc-level-4"> <a class="vector-toc-link" href="#Help_page"> <div class="vector-toc-text"> <span class="vector-toc-numb">3.1.6.1</span> <span>Help page</span> </div> </a> <ul id="toc-Help_page-sublist" class="vector-toc-list"> </ul> </li> </ul> </li> </ul> </li> <li id="toc-OutputPage.php" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#OutputPage.php"> <div class="vector-toc-text"> <span class="vector-toc-numb">3.2</span> <span>OutputPage.php</span> </div> </a> <ul id="toc-OutputPage.php-sublist" class="vector-toc-list"> <li id="toc-OutputPage->addHTML()" class="vector-toc-list-item vector-toc-level-3"> <a class="vector-toc-link" href="#OutputPage->addHTML()"> <div class="vector-toc-text"> <span class="vector-toc-numb">3.2.1</span> <span>OutputPage->addHTML()</span> </div> </a> <ul id="toc-OutputPage->addHTML()-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-OutputPage->addWikiText()" class="vector-toc-list-item vector-toc-level-3"> <a class="vector-toc-link" href="#OutputPage->addWikiText()"> <div class="vector-toc-text"> <span class="vector-toc-numb">3.2.2</span> <span>OutputPage->addWikiText()</span> </div> </a> <ul id="toc-OutputPage->addWikiText()-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-OutputPage->showErrorPage()" class="vector-toc-list-item vector-toc-level-3"> <a class="vector-toc-link" href="#OutputPage->showErrorPage()"> <div class="vector-toc-text"> <span class="vector-toc-numb">3.2.3</span> <span>OutputPage->showErrorPage()</span> </div> </a> <ul id="toc-OutputPage->showErrorPage()-sublist" class="vector-toc-list"> </ul> </li> </ul> </li> <li id="toc-WebRequest.php" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#WebRequest.php"> <div class="vector-toc-text"> <span class="vector-toc-numb">3.3</span> <span>WebRequest.php</span> </div> </a> <ul id="toc-WebRequest.php-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Database.php" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Database.php"> <div class="vector-toc-text"> <span class="vector-toc-numb">3.4</span> <span>Database.php</span> </div> </a> <ul id="toc-Database.php-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-User.php" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#User.php"> <div class="vector-toc-text"> <span class="vector-toc-numb">3.5</span> <span>User.php</span> </div> </a> <ul id="toc-User.php-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Title.php" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Title.php"> <div class="vector-toc-text"> <span class="vector-toc-numb">3.6</span> <span>Title.php</span> </div> </a> <ul id="toc-Title.php-sublist" class="vector-toc-list"> </ul> </li> </ul> </li> <li id="toc-Custom_special_pages" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#Custom_special_pages"> <div class="vector-toc-text"> <span class="vector-toc-numb">4</span> <span>Custom special pages</span> </div> </a> <ul id="toc-Custom_special_pages-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-FAQ" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#FAQ"> <div class="vector-toc-text"> <span class="vector-toc-numb">5</span> <span>FAQ</span> </div> </a> <button aria-controls="toc-FAQ-sublist" class="cdx-button cdx-button--weight-quiet cdx-button--icon-only vector-toc-toggle"> <span class="vector-icon mw-ui-icon-wikimedia-expand"></span> <span>Toggle FAQ subsection</span> </button> <ul id="toc-FAQ-sublist" class="vector-toc-list"> <li id="toc-Setting_an_Extension_Title" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Setting_an_Extension_Title"> <div class="vector-toc-text"> <span class="vector-toc-numb">5.1</span> <span>Setting an Extension Title</span> </div> </a> <ul id="toc-Setting_an_Extension_Title-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Localizing_the_Extension_Name" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Localizing_the_Extension_Name"> <div class="vector-toc-text"> <span class="vector-toc-numb">5.2</span> <span>Localizing the Extension Name</span> </div> </a> <ul id="toc-Localizing_the_Extension_Name-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Restricting_page_access" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Restricting_page_access"> <div class="vector-toc-text"> <span class="vector-toc-numb">5.3</span> <span>Restricting page access</span> </div> </a> <ul id="toc-Restricting_page_access-sublist" class="vector-toc-list"> <li id="toc-Do_not_display_your_Special_Page_on_Special:SpecialPages" class="vector-toc-list-item vector-toc-level-3"> <a class="vector-toc-link" href="#Do_not_display_your_Special_Page_on_Special:SpecialPages"> <div class="vector-toc-text"> <span class="vector-toc-numb">5.3.1</span> <span>Do not display your Special Page on Special:SpecialPages</span> </div> </a> <ul id="toc-Do_not_display_your_Special_Page_on_Special:SpecialPages-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Prevent_access_to_your_Special_Page" class="vector-toc-list-item vector-toc-level-3"> <a class="vector-toc-link" href="#Prevent_access_to_your_Special_Page"> <div class="vector-toc-text"> <span class="vector-toc-numb">5.3.2</span> <span>Prevent access to your Special Page</span> </div> </a> <ul id="toc-Prevent_access_to_your_Special_Page-sublist" class="vector-toc-list"> </ul> </li> </ul> </li> <li id="toc-Disabling_Special:UserLogin_and_Special:UserLogout_pages" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Disabling_Special:UserLogin_and_Special:UserLogout_pages"> <div class="vector-toc-text"> <span class="vector-toc-numb">5.4</span> <span>Disabling Special:UserLogin and Special:UserLogout pages</span> </div> </a> <ul id="toc-Disabling_Special:UserLogin_and_Special:UserLogout_pages-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Adding_logs" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Adding_logs"> <div class="vector-toc-text"> <span class="vector-toc-numb">5.5</span> <span>Adding logs</span> </div> </a> <ul id="toc-Adding_logs-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Changing_the_groups_on_Special:Specialpages" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Changing_the_groups_on_Special:Specialpages"> <div class="vector-toc-text"> <span class="vector-toc-numb">5.6</span> <span>Changing the groups on Special:Specialpages</span> </div> </a> <ul id="toc-Changing_the_groups_on_Special:Specialpages-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Unlisting_the_page_from_Special:Specialpages" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Unlisting_the_page_from_Special:Specialpages"> <div class="vector-toc-text"> <span class="vector-toc-numb">5.7</span> <span>Unlisting the page from Special:Specialpages</span> </div> </a> <ul id="toc-Unlisting_the_page_from_Special:Specialpages-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Getting_a_list_of_special_pages_and_their_aliases_on_a_wiki" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Getting_a_list_of_special_pages_and_their_aliases_on_a_wiki"> <div class="vector-toc-text"> <span class="vector-toc-numb">5.8</span> <span>Getting a list of special pages and their aliases on a wiki</span> </div> </a> <ul id="toc-Getting_a_list_of_special_pages_and_their_aliases_on_a_wiki-sublist" class="vector-toc-list"> </ul> </li> </ul> </li> <li id="toc-See_also" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#See_also"> <div class="vector-toc-text"> <span class="vector-toc-numb">6</span> <span>See also</span> </div> </a> <ul id="toc-See_also-sublist" class="vector-toc-list"> </ul> </li> </ul> </div> </div> </nav> </div> </div> <div class="mw-content-container"> <main id="content" class="mw-body"> <header class="mw-body-header vector-page-titlebar"> <nav aria-label="Contents" class="vector-toc-landmark"> <div id="vector-page-titlebar-toc" class="vector-dropdown vector-page-titlebar-toc vector-button-flush-left" > <input type="checkbox" id="vector-page-titlebar-toc-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-page-titlebar-toc" class="vector-dropdown-checkbox " aria-label="Toggle the table of contents" > <label id="vector-page-titlebar-toc-label" for="vector-page-titlebar-toc-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-listBullet mw-ui-icon-wikimedia-listBullet"></span> <span class="vector-dropdown-label-text">Toggle the table of contents</span> </label> <div class="vector-dropdown-content"> <div id="vector-page-titlebar-toc-unpinned-container" class="vector-unpinned-container"> </div> </div> </div> </nav> <h1 id="firstHeading" class="firstHeading mw-first-heading"><span class="mw-page-title-namespace">Manual</span><span class="mw-page-title-separator">:</span><span class="mw-page-title-main">Special pages</span></h1> <div class="mw-indicators"> </div> </header> <div class="vector-page-toolbar"> <div class="vector-page-toolbar-container"> <div id="left-navigation"> <nav aria-label="Namespaces"> <div id="p-associated-pages" class="vector-menu vector-menu-tabs mw-portlet mw-portlet-associated-pages" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-nstab-manual" class="selected vector-tab-noicon mw-list-item"><a href="/wiki/Manual:Special_pages" title="View the subject page [c]" accesskey="c"><span>Manual</span></a></li><li id="ca-talk" class="vector-tab-noicon mw-list-item"><a href="/wiki/Manual_talk:Special_pages" rel="discussion" title="Discussion about the content page [t]" accesskey="t"><span>Discussion</span></a></li> </ul> </div> </div> <div id="vector-variants-dropdown" class="vector-dropdown emptyPortlet" > <input type="checkbox" id="vector-variants-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-variants-dropdown" class="vector-dropdown-checkbox " aria-label="Change language variant" > <label id="vector-variants-dropdown-label" for="vector-variants-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet" aria-hidden="true" ><span class="vector-dropdown-label-text">English</span> </label> <div class="vector-dropdown-content"> <div id="p-variants" class="vector-menu mw-portlet mw-portlet-variants emptyPortlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> </div> </div> </nav> </div> <div id="right-navigation" class="vector-collapsible"> <nav aria-label="Views"> <div id="p-views" class="vector-menu vector-menu-tabs mw-portlet mw-portlet-views" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-view" class="selected vector-tab-noicon mw-list-item"><a href="/wiki/Manual:Special_pages"><span>Read</span></a></li><li id="ca-viewsource" class="vector-tab-noicon mw-list-item"><a href="/w/index.php?title=Manual:Special_pages&action=edit" title="This page is protected. You can view its source [e]" accesskey="e"><span>View source</span></a></li><li id="ca-history" class="vector-tab-noicon mw-list-item"><a href="/w/index.php?title=Manual:Special_pages&action=history" title="Past revisions of this page [h]" accesskey="h"><span>View history</span></a></li> </ul> </div> </div> </nav> <nav class="vector-page-tools-landmark" aria-label="Page tools"> <div id="vector-page-tools-dropdown" class="vector-dropdown vector-page-tools-dropdown" > <input type="checkbox" id="vector-page-tools-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-page-tools-dropdown" class="vector-dropdown-checkbox " aria-label="Tools" > <label id="vector-page-tools-dropdown-label" for="vector-page-tools-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet" aria-hidden="true" ><span class="vector-dropdown-label-text">Tools</span> </label> <div class="vector-dropdown-content"> <div id="vector-page-tools-unpinned-container" class="vector-unpinned-container"> <div id="vector-page-tools" class="vector-page-tools vector-pinnable-element"> <div class="vector-pinnable-header vector-page-tools-pinnable-header vector-pinnable-header-unpinned" data-feature-name="page-tools-pinned" data-pinnable-element-id="vector-page-tools" data-pinned-container-id="vector-page-tools-pinned-container" data-unpinned-container-id="vector-page-tools-unpinned-container" > <div class="vector-pinnable-header-label">Tools</div> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-page-tools.pin">move to sidebar</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-page-tools.unpin">hide</button> </div> <div id="p-cactions" class="vector-menu mw-portlet mw-portlet-cactions emptyPortlet vector-has-collapsible-items" title="More options" > <div class="vector-menu-heading"> Actions </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-more-view" class="selected vector-more-collapsible-item mw-list-item"><a href="/wiki/Manual:Special_pages"><span>Read</span></a></li><li id="ca-more-viewsource" class="vector-more-collapsible-item mw-list-item"><a href="/w/index.php?title=Manual:Special_pages&action=edit"><span>View source</span></a></li><li id="ca-more-history" class="vector-more-collapsible-item mw-list-item"><a href="/w/index.php?title=Manual:Special_pages&action=history"><span>View history</span></a></li> </ul> </div> </div> <div id="p-tb" class="vector-menu mw-portlet mw-portlet-tb" > <div class="vector-menu-heading"> General </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="t-whatlinkshere" class="mw-list-item"><a href="/wiki/Special:WhatLinksHere/Manual:Special_pages" title="A list of all wiki pages that link here [j]" accesskey="j"><span>What links here</span></a></li><li id="t-recentchangeslinked" class="mw-list-item"><a href="/wiki/Special:RecentChangesLinked/Manual:Special_pages" rel="nofollow" title="Recent changes in pages linked from this page [k]" accesskey="k"><span>Related changes</span></a></li><li id="t-upload" class="mw-list-item"><a href="//commons.wikimedia.org/wiki/Special:UploadWizard" title="Upload files [u]" accesskey="u"><span>Upload file</span></a></li><li id="t-specialpages" class="mw-list-item"><a href="/wiki/Special:SpecialPages" title="A list of all special pages [q]" accesskey="q"><span>Special pages</span></a></li><li id="t-permalink" class="mw-list-item"><a href="/w/index.php?title=Manual:Special_pages&oldid=6804659" title="Permanent link to this revision of this page"><span>Permanent link</span></a></li><li id="t-info" class="mw-list-item"><a href="/w/index.php?title=Manual:Special_pages&action=info" title="More information about this page"><span>Page information</span></a></li><li id="t-cite" class="mw-list-item"><a href="/w/index.php?title=Special:CiteThisPage&page=Manual%3ASpecial_pages&id=6804659&wpFormIdentifier=titleform" title="Information on how to cite this page"><span>Cite this page</span></a></li><li id="t-urlshortener" class="mw-list-item"><a href="/w/index.php?title=Special:UrlQ%C4%B1sald%C4%B1c%C4%B1s%C4%B1&url=https%3A%2F%2Fwww.mediawiki.org%2Fwiki%2FManual%3ASpecial_pages"><span>Get shortened URL</span></a></li><li id="t-urlshortener-qrcode" class="mw-list-item"><a href="/w/index.php?title=Special:QrKodu&url=https%3A%2F%2Fwww.mediawiki.org%2Fwiki%2FManual%3ASpecial_pages"><span>Download QR code</span></a></li> </ul> </div> </div> <div id="p-coll-print_export" class="vector-menu mw-portlet mw-portlet-coll-print_export" > <div class="vector-menu-heading"> Print/export </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="coll-create_a_book" class="mw-list-item"><a href="/w/index.php?title=Special:Book&bookcmd=book_creator&referer=Manual%3ASpecial+pages"><span>Create a book</span></a></li><li id="coll-download-as-rl" class="mw-list-item"><a href="/w/index.php?title=Special:DownloadAsPdf&page=Manual%3ASpecial_pages&action=show-download-screen"><span>Download as PDF</span></a></li><li id="t-print" class="mw-list-item"><a href="/w/index.php?title=Manual:Special_pages&printable=yes" title="Printable version of this page [p]" accesskey="p"><span>Printable version</span></a></li> </ul> </div> </div> <div id="p-wikibase-otherprojects" class="vector-menu mw-portlet mw-portlet-wikibase-otherprojects" > <div class="vector-menu-heading"> In other projects </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="t-wikibase" class="wb-otherproject-link wb-otherproject-wikibase-dataitem mw-list-item"><a href="https://www.wikidata.org/wiki/Special:EntityPage/Q119512495" title="Link to connected data repository item [g]" accesskey="g"><span>Wikidata item</span></a></li> </ul> </div> </div> </div> </div> </div> </div> </nav> </div> </div> </div> <div class="vector-column-end"> <div class="vector-sticky-pinned-container"> <nav class="vector-page-tools-landmark" aria-label="Page tools"> <div id="vector-page-tools-pinned-container" class="vector-pinned-container"> </div> </nav> <nav class="vector-appearance-landmark" aria-label="Appearance"> <div id="vector-appearance-pinned-container" class="vector-pinned-container"> <div id="vector-appearance" class="vector-appearance vector-pinnable-element"> <div class="vector-pinnable-header vector-appearance-pinnable-header vector-pinnable-header-pinned" data-feature-name="appearance-pinned" data-pinnable-element-id="vector-appearance" data-pinned-container-id="vector-appearance-pinned-container" data-unpinned-container-id="vector-appearance-unpinned-container" > <div class="vector-pinnable-header-label">Appearance</div> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-appearance.pin">move to sidebar</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-appearance.unpin">hide</button> </div> </div> </div> </nav> </div> </div> <div id="bodyContent" class="vector-body" aria-labelledby="firstHeading" data-mw-ve-target-container> <div class="vector-body-before-content"> <div id="siteSub" class="noprint">From mediawiki.org</div> </div> <div id="contentSub"><div id="mw-content-subtitle"></div></div> <div id="mw-content-text" class="mw-body-content"><div class="mw-pt-translate-header noprint nomobile" dir="ltr" lang="en"><a href="/w/index.php?title=Special:Translate&group=page-Manual%3ASpecial+pages&action=page&filter=&action_source=translate_page" title="Special:Translate">Translate this page</a></div><div class="mw-content-ltr mw-parser-output" lang="en" dir="ltr"><div class="mw-pt-languages noprint navigation-not-searchable" lang="en" dir="ltr"><div class="mw-pt-languages-label">Languages:</div><ul class="mw-pt-languages-list"><li><a href="/wiki/Manual:Special_pages/id" class="mw-pt-progress mw-pt-progress--low" title="Manual:Halaman khusus (9% translated)" lang="id" dir="ltr">Bahasa Indonesia</a></li> <li><a href="/wiki/Manual:Special_pages/de" class="mw-pt-progress mw-pt-progress--med" title="Manual:Spezialseiten (15% translated)" lang="de" dir="ltr">Deutsch</a></li> <li><span class="mw-pt-languages-ui mw-pt-languages-selected mw-pt-progress mw-pt-progress--complete" lang="en" dir="ltr">English</span></li> <li><a href="/wiki/Manual:Special_pages/nl" class="mw-pt-progress mw-pt-progress--complete" title="Handleiding:Speciale pagina's (100% translated)" lang="nl" dir="ltr">Nederlands</a></li> <li><a href="/wiki/Manual:Special_pages/da" class="mw-pt-progress mw-pt-progress--low" title="Manual:Special pages/da (0% translated)" lang="da" dir="ltr">dansk</a></li> <li><a href="/wiki/Manual:Special_pages/es" class="mw-pt-progress mw-pt-progress--low" title="Manual:Páginas especiales (9% translated)" lang="es" dir="ltr">español</a></li> <li><a href="/wiki/Manual:Special_pages/fr" class="mw-pt-progress mw-pt-progress--complete" title="Manual:Pages spéciales (100% translated)" lang="fr" dir="ltr">français</a></li> <li><a href="/wiki/Manual:Special_pages/hu" class="mw-pt-progress mw-pt-progress--low" title="Kézikönyv:Speciális lapok (6% translated)" lang="hu" dir="ltr">magyar</a></li> <li><a href="/wiki/Manual:Special_pages/pl" class="mw-pt-progress mw-pt-progress--low" title="Podręcznik:Strony specjalne (3% translated)" lang="pl" dir="ltr">polski</a></li> <li><a href="/wiki/Manual:Special_pages/pt" class="mw-pt-progress mw-pt-progress--med" title="Manual:Páginas Especiais (17% translated)" lang="pt" dir="ltr">português</a></li> <li><a href="/wiki/Manual:Special_pages/pt-br" class="mw-pt-progress mw-pt-progress--med" title="Manual:Páginas especiais (17% translated)" lang="pt-BR" dir="ltr">português do Brasil</a></li> <li><a href="/wiki/Manual:Special_pages/fi" class="mw-pt-progress mw-pt-progress--low" title="Manual:Toimintosivut (1% translated)" lang="fi" dir="ltr">suomi</a></li> <li><a href="/wiki/Manual:Special_pages/sv" class="mw-pt-progress mw-pt-progress--low" title="Manual:Specialsidor (1% translated)" lang="sv" dir="ltr">svenska</a></li> <li><a href="/wiki/Manual:Special_pages/cs" class="mw-pt-progress mw-pt-progress--high" title="Příručka:Speciální stránky (99% translated)" lang="cs" dir="ltr">čeština</a></li> <li><a href="/wiki/Manual:Special_pages/ru" class="mw-pt-progress mw-pt-progress--low" title="Руководство:Служебные страницы (11% translated)" lang="ru" dir="ltr">русский</a></li> <li><a href="/wiki/Manual:Special_pages/bn" class="mw-pt-progress mw-pt-progress--low" title="ম্যানুয়াল:বিশেষ পাতা (7% translated)" lang="bn" dir="ltr">বাংলা</a></li> <li><a href="/wiki/Manual:Special_pages/zh" class="mw-pt-progress mw-pt-progress--low" title="手册:特殊页面 (13% translated)" lang="zh" dir="ltr">中文</a></li> <li><a href="/wiki/Manual:Special_pages/ja" class="mw-pt-progress mw-pt-progress--high" title="Manual:特別ページ (98% translated)" lang="ja" dir="ltr">日本語</a></li> <li><a href="/wiki/Manual:Special_pages/ko" class="mw-pt-progress mw-pt-progress--low" title="Manual:특수 문서 (12% translated)" lang="ko" dir="ltr">한국어</a></li></ul></div> <style data-mw-deduplicate="TemplateStyles:r6651103">.mw-parser-output .nmbox{background:#f8f9fa;border:1px solid #AAA;box-sizing:border-box;margin:2px 0;padding:0}.mw-parser-output .nmbox *{box-sizing:border-box}.mw-parser-output .nmbox-header{background:#eaecf0;padding:4px 0.5em;font-weight:bold;text-align:center;white-space:nowrap}.mw-parser-output .nmbox .mbox-image{display:inline-block;padding-right:1em}.mw-parser-output .nmbox-text{border-top:1px solid #AAA;width:100%;padding:4px 0.5em}@media screen and (min-width:768px){.mw-parser-output .nmbox-header{display:table-cell;border-right:1px solid #AAA;width:1%}.mw-parser-output .nmbox-text{border-top:none;display:table-cell}}@media screen{html.skin-theme-clientpref-night .mw-parser-output .nmbox-header,html.skin-theme-clientpref-night .mw-parser-output .nmbox{background:transparent;color:inherit}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .nmbox-header,html.skin-theme-clientpref-os .mw-parser-output .nmbox{background:transparent;color:inherit}}</style> <div class="nmbox noprint mw-content-ltr"><div class="nmbox-header"><div class="nmbox-image mbox-image"><span class="skin-invert" typeof="mw:File"><a href="/wiki/Special:MyLanguage/Manual:Extensions" title="Special:MyLanguage/Manual:Extensions"><img src="//upload.wikimedia.org/wikipedia/commons/thumb/f/fb/OOjs_UI_icon_puzzle-ltr.svg/20px-OOjs_UI_icon_puzzle-ltr.svg.png" decoding="async" width="20" height="20" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/f/fb/OOjs_UI_icon_puzzle-ltr.svg/30px-OOjs_UI_icon_puzzle-ltr.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/f/fb/OOjs_UI_icon_puzzle-ltr.svg/40px-OOjs_UI_icon_puzzle-ltr.svg.png 2x" data-file-width="20" data-file-height="20" /></a></span></div><b><a href="/wiki/Special:MyLanguage/Manual:Extensions" title="Special:MyLanguage/Manual:Extensions">Extensions:</a><span style="display:none"><a href="/wiki/Manual:Extensions" title="Manual:Extensions"> </a></span></b> </div> <div class="nmbox-text mbox-text"><style data-mw-deduplicate="TemplateStyles:r6387430">.mw-parser-output .hlist dl,.mw-parser-output .hlist ol,.mw-parser-output .hlist ul{margin:0;padding:0}.mw-parser-output .hlist dd,.mw-parser-output .hlist dt,.mw-parser-output .hlist li{margin:0;display:inline}.mw-parser-output .hlist dl dl,.mw-parser-output .hlist dl ol,.mw-parser-output .hlist dl ul,.mw-parser-output .hlist ol dl,.mw-parser-output .hlist ol ol,.mw-parser-output .hlist ol ul,.mw-parser-output .hlist ul dl,.mw-parser-output .hlist ul ol,.mw-parser-output .hlist ul ul{display:inline}.mw-parser-output .hlist .mw-empty-li,.mw-parser-output .hlist .mw-empty-elt{display:none}.mw-parser-output .hlist dt:after{content:": "}.mw-parser-output .hlist dd:after,.mw-parser-output .hlist li:after{content:" · ";font-weight:bold}.mw-parser-output .hlist dd:last-child:after,.mw-parser-output .hlist dt:last-child:after,.mw-parser-output .hlist li:last-child:after{content:none}.mw-parser-output .hlist dd dd:first-child:before,.mw-parser-output .hlist dd dt:first-child:before,.mw-parser-output .hlist dd li:first-child:before,.mw-parser-output .hlist dt dd:first-child:before,.mw-parser-output .hlist dt dt:first-child:before,.mw-parser-output .hlist dt li:first-child:before,.mw-parser-output .hlist li dd:first-child:before,.mw-parser-output .hlist li dt:first-child:before,.mw-parser-output .hlist li li:first-child:before{content:" (";font-weight:normal}.mw-parser-output .hlist dd dd:last-child:after,.mw-parser-output .hlist dd dt:last-child:after,.mw-parser-output .hlist dd li:last-child:after,.mw-parser-output .hlist dt dd:last-child:after,.mw-parser-output .hlist dt dt:last-child:after,.mw-parser-output .hlist dt li:last-child:after,.mw-parser-output .hlist li dd:last-child:after,.mw-parser-output .hlist li dt:last-child:after,.mw-parser-output .hlist li li:last-child:after{content:")";font-weight:normal}.mw-parser-output .hlist ol{counter-reset:listitem}.mw-parser-output .hlist ol>li{counter-increment:listitem}.mw-parser-output .hlist ol>li:before{content:" "counter(listitem)"\a0 "}.mw-parser-output .hlist dd ol>li:first-child:before,.mw-parser-output .hlist dt ol>li:first-child:before,.mw-parser-output .hlist li ol>li:first-child:before{content:" ("counter(listitem)"\a0 "}</style><div class="hlist"> <ul><li><a href="/wiki/Special:MyLanguage/Manual:Developing_extensions" title="Special:MyLanguage/Manual:Developing extensions">Development</a><span style="display:none"><a href="/wiki/Manual:Developing_extensions" title="Manual:Developing extensions"> </a></span></li> <li><a href="/wiki/Special:MyLanguage/Manual:Tag_extensions" title="Special:MyLanguage/Manual:Tag extensions">Tag extensions</a><span style="display:none"><a href="/wiki/Manual:Tag_extensions" title="Manual:Tag extensions"> </a></span></li> <li><a href="/wiki/Special:MyLanguage/Manual:Parser_functions" title="Special:MyLanguage/Manual:Parser functions">Parser functions</a><span style="display:none"><a href="/wiki/Manual:Parser_functions" title="Manual:Parser functions"> </a></span></li> <li><a href="/wiki/Special:MyLanguage/Manual:Hooks" title="Special:MyLanguage/Manual:Hooks">Hooks</a><span style="display:none"><a href="/wiki/Manual:Hooks" title="Manual:Hooks"> </a></span></li> <li><b><a href="/wiki/Special:MyLanguage/Manual:Special_pages" title="Special:MyLanguage/Manual:Special pages">Special pages</a></b><span style="display:none"><a class="mw-selflink selflink"> </a></span></li> <li><a href="/wiki/Special:MyLanguage/Manual:Skins" title="Special:MyLanguage/Manual:Skins">Skins</a><span style="display:none"><a href="/wiki/Manual:Skins" title="Manual:Skins"> </a></span></li> <li><a href="/wiki/Special:MyLanguage/Manual:Magic_words" title="Special:MyLanguage/Manual:Magic words">Magic words</a><span style="display:none"><a href="/wiki/Manual:Magic_words" title="Manual:Magic words"> </a></span></li> <li><a href="/wiki/Special:MyLanguage/API:Extensions" title="Special:MyLanguage/API:Extensions">API</a><span style="display:none"><a href="/wiki/API:Extensions" title="API:Extensions"> </a></span></li> <li><a href="/wiki/Special:MyLanguage/Manual:Page_content_models" title="Special:MyLanguage/Manual:Page content models">Content models</a><span style="display:none"><a href="/wiki/Manual:Page_content_models" title="Manual:Page content models"> </a></span></li></ul> </div></div> </div> <figure class="mw-halign-right" typeof="mw:File"><a href="/wiki/File:MediaWiki-extensions-icon.svg" class="mw-file-description"><img alt="MediaWiki extensions" src="//upload.wikimedia.org/wikipedia/commons/thumb/2/23/MediaWiki-extensions-icon.svg/125px-MediaWiki-extensions-icon.svg.png" decoding="async" width="125" height="84" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/2/23/MediaWiki-extensions-icon.svg/188px-MediaWiki-extensions-icon.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/2/23/MediaWiki-extensions-icon.svg/250px-MediaWiki-extensions-icon.svg.png 2x" data-file-width="686" data-file-height="463" /></a><figcaption></figcaption></figure> <p><b>Special pages</b> are pages that are created by the software on demand to perform a specific function. </p><p>For example, a special page might show all pages that have one or more links to an external site or it might create a form providing user submitted feedback. </p><p>Special pages are located in their own <a href="/wiki/Special:MyLanguage/Manual:Namespace" title="Special:MyLanguage/Manual:Namespace">namespace</a> (<i><b>Special:</b></i>) and are not editable directly like other pages. <a href="/wiki/Special:MyLanguage/Developers" title="Special:MyLanguage/Developers">Developers</a><span style="display:none"><a href="/wiki/Developers" title="Developers"> </a></span> can also create new special pages. </p><p>These pages by default are user-accessible and will generally show up in the list of all special pages at <a href="/wiki/Special:SpecialPages" title="Special:SpecialPages">Special:SpecialPages</a>. Some special pages are only accessible to users with certain permissions and accesses. Other special pages don't show up on the special page list at all and are only used by the wiki internally. </p> <meta property="mw:PageProp/toc" /> <div class="mw-heading mw-heading2"><h2 id="General_Information">General Information</h2></div> <p>All built-in special pages that come with MediaWiki are called <code>SpecialSomename.php</code> and are located in the <code>includes/specials</code> directory. Core special pages must be registered in the core list located in <code>includes/specialpage/SpecialPageFactory.php</code> in order to be loaded by MediaWiki. Special pages created by third party developers are generally stored in the <code>extensions</code> directory in their own file or as part of a larger extension. All special pages inherit from a class called <span class="plainlinks"><a class="external text" href="https://doc.wikimedia.org/mediawiki-core/master/php/classSpecialPage.html">SpecialPage</a></span> which is defined in <code>includes/specialpage/SpecialPage.php</code>. When a new special page is created, the user rights needed to access the page can be defined. These rights specify, among other things, whether the page will show up on <a href="/wiki/Special:SpecialPages" title="Special:SpecialPages">Special:SpecialPages</a> and whether the page is includable in other pages. </p><p>Special pages also have unique names that can be customized on a wiki. The general form is "Special:Pagename" where both "Special" and "Pagename" are customizable. The Special pseudo <a href="/wiki/Special:MyLanguage/Manual:Namespaces" title="Special:MyLanguage/Manual:Namespaces">namespace</a><span style="display:none"><a href="/wiki/Manual:Namespaces" class="mw-redirect" title="Manual:Namespaces"> </a></span> can be translated in other languages. This translated namespace can be produced with the wikitext {{ns:special}}, on this wiki giving "Special". The <b>name</b> of the special page can also be redefined in a system message, for the site language, with the generic name of the special page as the ID. </p><p>A special page may or may not allow input. For example, <a href="/wiki/Special:Export" title="Special:Export">Special:Export</a> allows a user to define a specific page to export by calling <a href="/wiki/Special:Export/Sun" title="Special:Export/Sun">Special:Export/Sun</a>. If the special page allows complex input, additional parameters will be sent to the <a href="https://en.wikipedia.org/wiki/Query_string" class="extiw" title="w:Query string">query string</a> component of the URL for processing, e.g. <a class="external free" href="https://www.mediawiki.org/w/index.php?title=Special:Recentchanges&days=3&limit=250">https://www.mediawiki.org/w/index.php?title=Special:Recentchanges&days=3&limit=250</a>. </p> <style data-mw-deduplicate="TemplateStyles:r6651107">.mw-parser-output .note{background-position:left 7px top 50%;padding:0.5em 0.5em 0.5em 40px;margin:0.5em 0;overflow:hidden;background-color:#f8f9fa;color:#333;background-repeat:no-repeat;border:1px solid #ddd}.mw-parser-output .note-inline{display:inline-block;vertical-align:middle}.mw-parser-output .note-info{background-color:#eaf3ff;color:#333;background-image:url("https://upload.wikimedia.org/wikipedia/commons/e/ec/OOjs_UI_icon_information-progressive.svg");background-size:25px;border-color:#a3caff;padding-left:40px;min-height:25px}.mw-parser-output .note-reminder{background-color:#fff9ea;color:#333;background-image:url("https://upload.wikimedia.org/wikipedia/commons/a/a8/OOjs_UI_icon_lightbulb-yellow.svg");background-size:25px;border-color:#fc3;min-height:25px}.mw-parser-output .note-warn{background-color:#fff9ea;color:#333;background-image:url("https://upload.wikimedia.org/wikipedia/commons/3/3b/OOjs_UI_icon_alert-warning.svg");background-size:25px;border-color:#fc3;min-height:25px}.mw-parser-output .note-error{background-color:#fee7e6;color:#333;background-image:url("https://upload.wikimedia.org/wikipedia/commons/b/bf/OOjs_UI_icon_notice-destructive.svg");background-size:25px;border-color:#c33;min-height:25px}@media screen{html.skin-theme-clientpref-night .mw-parser-output .note{background-color:transparent;color:inherit}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .note{background-color:transparent;color:inherit}}</style><div role="note" class="note note-info"> <ul><li>There are various ways to make <a href="/wiki/Special:MyLanguage/Help:Special_pages" title="Special:MyLanguage/Help:Special pages">special pages</a>, but the one below is used by the bulk of official <a href="/wiki/Special:MyLanguage/Manual:Extensions" title="Special:MyLanguage/Manual:Extensions">extensions</a><span style="display:none"><a href="/wiki/Manual:Extensions" title="Manual:Extensions"> </a></span>, and adherence to this style is recommended. Also, be sure to include a credits block in the new special page for 'specialpage'. See <code><a href="/wiki/Special:MyLanguage/Manual:$wgExtensionCredits" title="Special:MyLanguage/Manual:$wgExtensionCredits">$wgExtensionCredits</a><span style="display:none"><a href="/wiki/Manual:$wgExtensionCredits" title="Manual:$wgExtensionCredits"> </a></span></code> for more details.</li> <li>After making a new special page, be sure to add it to <a href="/wiki/Special:MyLanguage/Category:Special_page_extensions" title="Special:MyLanguage/Category:Special page extensions">Category:Special page extensions</a><span style="display:none"><a href="/wiki/Category:Special_page_extensions" title="Category:Special page extensions"> </a></span> so other people can find it.</li> <li>Special pages cannot be included within frames unless you use <code>$wgOut->allowClickjacking();</code></li></ul></div> <div class="mw-heading mw-heading2"><h2 id="Basic_special_page_template">Basic special page template</h2></div> <style data-mw-deduplicate="TemplateStyles:r6651108">.mw-parser-output table.ombox{margin:4px 10%;border-collapse:collapse;border:1px solid #a2a9b1;background-color:#f8f9fa;color:#333;box-sizing:border-box}.mw-parser-output .ombox td.mbox-empty-cell{border:none;padding:0;width:1px}.mw-parser-output .ombox th.mbox-text,.mw-parser-output .ombox td.mbox-text{border:none;padding:0.25em 0.9em;width:100%}.mw-parser-output .ombox td.mbox-image{border:none;text-align:center;padding:2px 0 2px 0.9em}.mw-parser-output .ombox td.mbox-imageright{border:none;text-align:center;padding:2px 0.9em 2px 0}.mw-parser-output table.ombox-notice{border-color:#a2a9b1}.mw-parser-output table.ombox-speedy{background-color:#fee7e6;color:#333}.mw-parser-output table.ombox-speedy,.mw-parser-output table.ombox-delete{border-color:#b32424;border-width:2px}.mw-parser-output table.ombox-content{border-color:#f28500}.mw-parser-output table.ombox-style{border-color:#fc3}.mw-parser-output table.ombox-move{border-color:#9932cc}.mw-parser-output table.ombox-protection{border-color:#a2a9b1;border-width:2px}html body.mediawiki .mw-parser-output .ombox.mbox-small{clear:right;float:right;margin:4px 0 4px 1em;box-sizing:border-box;width:238px;font-size:88%;line-height:1.25em}@media screen{html.skin-theme-clientpref-night .mw-parser-output table.ombox{background-color:transparent;color:inherit}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output table.ombox{background-color:transparent;color:inherit}}</style><table class="ombox ombox-notice plainlinks" role="presentation"><tbody><tr><td class="mbox-image"><span typeof="mw:File"><span><img alt="" src="//upload.wikimedia.org/wikipedia/commons/thumb/e/ec/OOjs_UI_icon_information-progressive.svg/40px-OOjs_UI_icon_information-progressive.svg.png" decoding="async" width="40" height="40" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/e/ec/OOjs_UI_icon_information-progressive.svg/60px-OOjs_UI_icon_information-progressive.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/e/ec/OOjs_UI_icon_information-progressive.svg/80px-OOjs_UI_icon_information-progressive.svg.png 2x" data-file-width="20" data-file-height="20" /></span></span></td><td class="mbox-text">MediaWiki 1.25 introduced a <a href="/wiki/Special:MyLanguage/Manual:Extension_registration" title="Special:MyLanguage/Manual:Extension registration">new way</a> to load an extension. For older unsupported versions of MediaWiki, see an <a class="external text" href="https://www.mediawiki.org/w/index.php?title=Manual:Special_pages&oldid=2331671">older revision</a>.</td></tr></tbody></table> <p>Most special page extensions require three files: </p> <ul><li>Small setup file, which loads every time MediaWiki starts.</li> <li>File with the bulk of the code.</li> <li>Localisation file</li></ul> <p>MediaWiki coding conventions define the three files like this: </p> <ul><li><code>MyExtension/extension.json</code> – The setup file.</li> <li><code>MyExtension/includes/Special.php</code> – The special page code.</li> <li><code>i18n/*.json</code> – The <a href="/wiki/Special:MyLanguage/Help:System_message#Localisation_file_format" title="Special:MyLanguage/Help:System message">localisation file</a><span style="display:none"><a href="/wiki/Help:System_message#Localisation_file_format" title="Help:System message"> </a></span>.</li></ul> <p>Place all of the files in a new directory inside your MediaWiki <code>extensions/</code> directory. </p><p>You should name the special page file after the extension. For example, <a href="/wiki/Special:MyLanguage/Extension:Gadgets" title="Special:MyLanguage/Extension:Gadgets">Extension:Gadgets</a><span style="display:none"><a href="/wiki/Extension:Gadgets" title="Extension:Gadgets"> </a></span> contains the file <code>SpecialGadgets.php</code>. If your extension uses more than one special page, you'll need more names. </p><p>In the example below, the special page's name is <b>MyExtension</b>. </p><p>After creating the files listed below, adding the following line to <b>LocalSettings.php</b> enables the extension: </p> <div class="mw-highlight mw-highlight-lang-php mw-content-ltr" dir="ltr"><pre><span></span><span class="nx">wfLoadExtension</span><span class="p">(</span> <span class="s1">'MyExtension'</span> <span class="p">);</span> </pre></div> <div class="mw-heading mw-heading3"><h3 id="The_setup_file">The setup file</h3></div> <p>Example setup file for <code>MyExtension/extension.json</code>: </p> <div class="mw-highlight mw-highlight-lang-json mw-content-ltr" dir="ltr"><pre><span></span><span class="p">{</span> <span class="w"> </span><span class="nt">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"MyExtension"</span><span class="p">,</span> <span class="w"> </span><span class="nt">"version"</span><span class="p">:</span><span class="w"> </span><span class="s2">"0.0.0"</span><span class="p">,</span> <span class="w"> </span><span class="nt">"author"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span> <span class="w"> </span><span class="s2">"Your Name"</span> <span class="w"> </span><span class="p">],</span> <span class="w"> </span><span class="nt">"url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"https://www.mediawiki.org/wiki/Extension:MyExtension"</span><span class="p">,</span> <span class="w"> </span><span class="nt">"descriptionmsg"</span><span class="p">:</span><span class="w"> </span><span class="s2">"myextension-desc"</span><span class="p">,</span> <span class="w"> </span><span class="nt">"license-name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"MIT"</span><span class="p">,</span> <span class="w"> </span><span class="nt">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"other"</span><span class="p">,</span> <span class="w"> </span><span class="nt">"AutoloadNamespaces"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="nt">"MediaWiki\\Extension\\MyExtension\\"</span><span class="p">:</span><span class="w"> </span><span class="s2">"src/"</span> <span class="w"> </span><span class="p">},</span> <span class="w"> </span><span class="nt">"SpecialPages"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="nt">"MyExtension"</span><span class="p">:</span><span class="w"> </span><span class="s2">"MediaWiki\\Extension\\MyExtension\\Special"</span> <span class="w"> </span><span class="p">},</span> <span class="w"> </span><span class="nt">"MessagesDirs"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="nt">"MyExtension"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span> <span class="w"> </span><span class="s2">"i18n"</span> <span class="w"> </span><span class="p">]</span> <span class="w"> </span><span class="p">},</span> <span class="w"> </span><span class="nt">"manifest_version"</span><span class="p">:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span> <span class="w"> </span><span class="nt">"requires"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="nt">"MediaWiki"</span><span class="p">:</span><span class="w"> </span><span class="s2">">= 1.41.0"</span><span class="p">,</span> <span class="w"> </span><span class="nt">"platform"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="nt">"php"</span><span class="p">:</span><span class="w"> </span><span class="s2">">= 5.6"</span> <span class="w"> </span><span class="p">},</span> <span class="w"> </span><span class="nt">"extensions"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="nt">"dependendExtension"</span><span class="p">:</span><span class="w"> </span><span class="s2">"*"</span> <span class="w"> </span><span class="p">}</span> <span class="w"> </span><span class="p">}</span> <span class="p">}</span> </pre></div> <p>This file registers several important and mandatory things: </p> <ul><li>The location of the MediaWiki\Extension\MyExtension\Special class;</li> <li>The location of the localisation files;</li> <li>The new special page and its class name.</li></ul> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r6651107"><div role="note" class="note note-info">If you get the error <code>InvalidArgumentException: Provided specification is not an array</code>, it generally means that MediaWiki could not find the class specified in extension.json that implements your special page.</div> <div class="mw-heading mw-heading3"><h3 id="The_special_page_file">The special page file</h3></div> <p>The body file (<code>MyExtension/src/Special.php</code>) should contain a subclass of <code>SpecialPage</code> or one of its subclasses. This file loads automatically when someone requests the special page. The example below implements the subclass SpecialMyExtension. </p><p>You need the <code>__construct()</code> constructor because its first parameter names your special page. </p><p><code>execute()</code> is the main function called when a special page is accessed. This function overrides the function <code class="mw-highlight mw-highlight-lang-php mw-content-ltr" style="" dir="ltr"><span class="nx">SpecialPage</span><span class="o">::</span><span class="na">execute</span><span class="p">()</span></code>. It passes the single parameter <code>$par</code>, the subpage component of the current title. For example, if someone follows a link to <a href="/wiki/Special:MyExtension/blah" class="new" title="Special:MyExtension/blah (page does not exist)">Special:MyExtension/blah</a>, <code>$par</code> contains "blah". </p><p>You should run Wikitext and HTML output through <code>$wgOut</code>. Do not use 'print' or 'echo' directly when working within the wiki's user interface. </p><p>However, if you use your special page as an access point to custom XML or binary output, see <a href="/wiki/Special:MyLanguage/Taking_over_output_in_your_special_page" title="Special:MyLanguage/Taking over output in your special page">Taking over output in your special page</a><span style="display:none"><a href="/wiki/Taking_over_output_in_your_special_page" title="Taking over output in your special page"> </a></span>. </p> <div class="mw-highlight mw-highlight-lang-php mw-content-ltr" dir="ltr"><pre><span></span><span class="cp"><?php</span> <span class="k">namespace</span> <span class="nx">MediaWiki\Extension\MyExtension</span><span class="p">;</span> <span class="k">class</span> <span class="nc">SpecialMyExtension</span> <span class="k">extends</span> <span class="nx">\SpecialPage</span> <span class="p">{</span> <span class="k">public</span> <span class="k">function</span> <span class="fm">__construct</span><span class="p">()</span> <span class="p">{</span> <span class="k">parent</span><span class="o">::</span><span class="na">__construct</span><span class="p">(</span> <span class="s1">'MyExtension'</span> <span class="p">);</span> <span class="p">}</span> <span class="k">public</span> <span class="k">function</span> <span class="nf">execute</span><span class="p">(</span> <span class="nv">$par</span> <span class="p">)</span> <span class="p">{</span> <span class="nv">$request</span> <span class="o">=</span> <span class="nv">$this</span><span class="o">-></span><span class="na">getRequest</span><span class="p">();</span> <span class="nv">$output</span> <span class="o">=</span> <span class="nv">$this</span><span class="o">-></span><span class="na">getOutput</span><span class="p">();</span> <span class="nv">$this</span><span class="o">-></span><span class="na">setHeaders</span><span class="p">();</span> <span class="c1"># Get request data from, e.g.</span> <span class="nv">$param</span> <span class="o">=</span> <span class="nv">$request</span><span class="o">-></span><span class="na">getText</span><span class="p">(</span> <span class="s1">'param'</span> <span class="p">);</span> <span class="c1"># Do stuff</span> <span class="c1"># ...</span> <span class="nv">$wikitext</span> <span class="o">=</span> <span class="s1">'Hello world!'</span><span class="p">;</span> <span class="nv">$output</span><span class="o">-></span><span class="na">addWikiTextAsInterface</span><span class="p">(</span> <span class="nv">$wikitext</span> <span class="p">);</span> <span class="p">}</span> <span class="p">}</span> </pre></div> <p><span class="anchor" id="The_Messages/Internationalization_File"></span> </p> <div class="mw-heading mw-heading3"><h3 id="The_localisation_file">The localisation file</h3></div> <dl><dd><i>See <a href="/wiki/Special:MyLanguage/Help:System_message#Adding_new_messages" title="Special:MyLanguage/Help:System message">Help:System message</a><span style="display:none"><a href="/wiki/Help:System_message#Adding_new_messages" title="Help:System message"> </a></span> for how to get them translated.</i></dd></dl> <p>All special pages specify a title, like <code>'My Extension'</code>. </p> <ul><li>The title is used in the <style data-mw-deduplicate="TemplateStyles:r4673781">.mw-parser-output .nowrap,.mw-parser-output .nowrap a:before,.mw-parser-output .nowrap .selflink:before{white-space:nowrap}</style><code class="mw-highlight nowrap"><span class="p">‎<</span><span class="nt">title</span><span class="p">></span></code> and <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r4673781"><code class="mw-highlight nowrap"><span class="p">‎<</span><span class="nt">h1</span><span class="p">></span></code> elements of the extension's page and on <a href="/wiki/Special:SpecialPages" title="Special:SpecialPages">Special:SpecialPages</a>.</li> <li>It can be anything, but should describe the special page and extension.</li> <li>It's specified through a message. The structure of the message is a key-value pair. The key, <code>'myextension'</code>, <i>must</i> be all lowercase.</li></ul> <p>An example of a localisation file in <code>MyExtension/i18n/en.json</code>: </p> <div class="mw-highlight mw-highlight-lang-javascript mw-content-ltr" dir="ltr"><pre><span></span><span class="p">{</span> <span class="w"> </span><span class="s2">"@metadata"</span><span class="o">:</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="s2">"authors"</span><span class="o">:</span><span class="w"> </span><span class="p">[</span> <span class="w"> </span><span class="s2">"<your username>"</span> <span class="w"> </span><span class="p">]</span> <span class="w"> </span><span class="p">},</span> <span class="w"> </span><span class="s2">"myextension"</span><span class="o">:</span><span class="w"> </span><span class="s2">"My Extension"</span><span class="p">,</span> <span class="w"> </span><span class="s2">"myextension-desc"</span><span class="o">:</span><span class="w"> </span><span class="s2">"Adds the MyExtension functionality."</span><span class="p">,</span> <span class="w"> </span><span class="s2">"myextension-summary"</span><span class="o">:</span><span class="w"> </span><span class="s2">"On this special page, do this simple thing and earn wonders."</span><span class="p">,</span> <span class="w"> </span><span class="s2">"group-myextensionrole"</span><span class="o">:</span><span class="w"> </span><span class="s2">"Role of myextension"</span><span class="p">,</span> <span class="w"> </span><span class="s2">"group-myextensionrole-member"</span><span class="o">:</span><span class="w"> </span><span class="s2">"Member of role of myextension"</span><span class="p">,</span> <span class="w"> </span><span class="s2">"grouppage-myextensionrole"</span><span class="o">:</span><span class="w"> </span><span class="s2">"{{ns:project}}:Role of myextension"</span><span class="p">,</span> <span class="w"> </span><span class="s2">"action-myextension"</span><span class="o">:</span><span class="w"> </span><span class="s2">"XYZ doing."</span><span class="p">,</span> <span class="w"> </span><span class="s2">"right-myextension"</span><span class="o">:</span><span class="w"> </span><span class="s2">"to do xyz"</span> <span class="p">}</span> </pre></div> <p>In <code>i18n/qqq.json</code>, the <a href="/wiki/Special:MyLanguage/Help:System_message#Message_documentation" title="Special:MyLanguage/Help:System message">message documentation</a>: </p> <div class="mw-highlight mw-highlight-lang-javascript mw-content-ltr" dir="ltr"><pre><span></span><span class="p">{</span> <span class="w"> </span><span class="s2">"@metadata"</span><span class="o">:</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="s2">"authors"</span><span class="o">:</span><span class="w"> </span><span class="p">[</span> <span class="w"> </span><span class="s2">"<your username>"</span> <span class="w"> </span><span class="p">]</span> <span class="w"> </span><span class="p">},</span> <span class="w"> </span><span class="s2">"myextension"</span><span class="o">:</span><span class="w"> </span><span class="s2">"The name of the extension's entry in Special:SpecialPages"</span><span class="p">,</span> <span class="w"> </span><span class="s2">"myextension-desc"</span><span class="o">:</span><span class="w"> </span><span class="s2">"{{desc}}"</span><span class="p">,</span> <span class="w"> </span><span class="s2">"myextension-summary"</span><span class="o">:</span><span class="w"> </span><span class="s2">"Description appearing on top of Special:MyExtension."</span><span class="p">,</span> <span class="w"> </span><span class="s2">"action-myextension"</span><span class="o">:</span><span class="w"> </span><span class="s2">"{{doc-action|myextension}}"</span><span class="p">,</span> <span class="w"> </span><span class="s2">"right-myextension"</span><span class="o">:</span><span class="w"> </span><span class="s2">"{{doc-right|myextension}}"</span> <span class="p">}</span> </pre></div> <p>Note that IDs should not start with an uppercase letter, and that a space in the ID should be written in the code as an underscore. </p><p>The <code>-summary</code> message is optional. It's created automatically by the parent class and shown on top of the special page, usually for a concise description of what the user can do on it. If you don't define its content, it will only be used when wiki administrators customize it on the wiki. </p> <div class="mw-heading mw-heading3"><h3 id="The_aliases_file">The aliases file</h3></div> <p>You can also internationalize the name of the special page by creating aliases for it. The example below uses the file "MyExtension.i18n.alias.php". In this example, the special page <code>MyExtension</code> registers an <i>alias</i> so the page becomes accessible at <code>.../Special:My Extension</code> and <code>.../Spezial:Meine_Erweiterung</code> in German. </p><p>Add your alias file to <code>extension.json</code>: </p> <div class="mw-highlight mw-highlight-lang-javascript mw-content-ltr" dir="ltr"><pre><span></span><span class="p">...</span> <span class="w"> </span><span class="s2">"ExtensionMessagesFiles"</span><span class="o">:</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="s2">"MyExtensionAlias"</span><span class="o">:</span><span class="w"> </span><span class="s2">"MyExtension.i18n.alias.php"</span> <span class="w"> </span><span class="p">},</span> <span class="p">...</span> </pre></div> <p>Add special page aliases to <code>MyExtension.i18n.alias.php</code>: </p> <div class="mw-highlight mw-highlight-lang-php mw-content-ltr" dir="ltr"><pre><span></span><span class="cp"><?php</span> <span class="sd">/**</span> <span class="sd"> * Aliases for myextension</span> <span class="sd"> *</span> <span class="sd"> * @file</span> <span class="sd"> * @ingroup Extensions</span> <span class="sd"> */</span> <span class="nv">$specialPageAliases</span> <span class="o">=</span> <span class="p">[];</span> <span class="sd">/** English</span> <span class="sd"> * @author <your username></span> <span class="sd"> */</span> <span class="nv">$specialPageAliases</span><span class="p">[</span><span class="s1">'en'</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span> <span class="s1">'MyExtension'</span> <span class="o">=></span> <span class="p">[</span> <span class="s1">'MyExtension'</span><span class="p">,</span> <span class="s1">'My Extension'</span> <span class="p">],</span> <span class="p">];</span> <span class="sd">/** Deutsch</span> <span class="sd"> * @author <your username></span> <span class="sd"> */</span> <span class="nv">$specialPageAliases</span><span class="p">[</span><span class="s1">'de'</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span> <span class="s1">'MyExtension'</span> <span class="o">=></span> <span class="p">[</span> <span class="s1">'MeineErweiterung'</span><span class="p">,</span> <span class="s1">'Meine Erweiterung'</span> <span class="p">],</span> <span class="p">];</span> </pre></div> <p>Again, you should write a space in the ID and an underscore in the code. </p><p>For the page header and linking, the usual rules for page names apply. </p><p>If <code><a href="/wiki/Special:MyLanguage/Manual:$wgCapitalLinks" title="Special:MyLanguage/Manual:$wgCapitalLinks">$wgCapitalLinks</a><span style="display:none"><a href="/wiki/Manual:$wgCapitalLinks" title="Manual:$wgCapitalLinks"> </a></span></code> is true, a lowercase letter is converted to uppercase, and an underscore is displayed as a space. </p><p>For example, instead of the above, we could use <code>'my_extension' => 'My extension'</code>, assuming we consistently identified the extension as <code>my_extension</code> elsewhere. </p><p>Note that in the associative array for the English language, the string identifying our SpecialPage (<code>MyExtension</code> in the example) is <i>also</i> a valid title. </p><p>Also note, the first element of <code class="mw-highlight mw-highlight-lang-php mw-content-ltr" style="" dir="ltr"><span class="nv">$specialPageAliases</span><span class="p">[</span><span class="s1">'en'</span><span class="p">][</span><span class="s1">'MyExtension'</span><span class="p">]</span></code> <i>must</i> be the same as the key (<code>'MyExtension'</code>)! Otherwise <a href="/wiki/Special:SpecialPages" title="Special:SpecialPages">Special:Specialpages</a> will not list the page. </p> <div class="mw-heading mw-heading4"><h4 id="Special_page_group">Special page group</h4></div> <p>You can set which group your special page appears under on <a href="/wiki/Special:SpecialPages" title="Special:SpecialPages">Special:SpecialPages</a> by overriding <code>SpecialPage::getGroupName()</code> in your subclass. </p> <div class="mw-highlight mw-highlight-lang-php mw-content-ltr" dir="ltr"><pre><span></span> <span class="sd">/**</span> <span class="sd"> * Override the parent to set where the special page appears on Special:SpecialPages</span> <span class="sd"> * 'other' is the default. If that's what you want, you do not need to override.</span> <span class="sd"> * Specify 'media' to use the <code>specialpages-group-media</code> system interface message, which translates to 'Media reports and uploads' in English;</span> <span class="sd"> * </span> <span class="sd"> * @return string</span> <span class="sd"> */</span> <span class="k">function</span> <span class="nf">getGroupName</span><span class="p">()</span> <span class="p">{</span> <span class="k">return</span> <span class="s1">'media'</span><span class="p">;</span> <span class="p">}</span> </pre></div> <p>Some common values are 'login', 'maintenance', 'media', 'other', 'pagetools', 'redirects', 'users'. You can see the accepted values at Special:AllMessages (search for <b>specialpages-group</b>) or browse the wiki using the pseudo language 'qqx' by going to Special:SpecialPages?uselang=qqx) and looking at the headings. Specify the word 'media' to use the interface message 'specialpages-group-media'. </p><p>If your special page doesn't fit into any of the preconfigured headings, you can add a new heading by adding it to your localisation file, see <a href="#The_localisation_file">The localisation file</a>). </p><p>The standard page groups that come with MediaWiki are listed in the localisation file. For example, the English messages are in <code>languages/i18n/en.json</code> and begin with <code>specialpages-group-</code>. If you want to categorize your special page under <code>users</code>, then the message is <code>specialpages-group-users</code>. The value for this key is the text that appears as the name of that category, for example, <code>Users and rights</code>. </p><p>If your special page does not seem to fit under any of the existing categories, you can always make a new one. In your extension's localisation file simply insert a new key for the <code>messages</code> array. In this example, we define the <code>gamification</code> group: </p> <div class="mw-highlight mw-highlight-lang-json mw-content-ltr" dir="ltr"><pre><span></span><span class="p">{</span> <span class="w"> </span><span class="nt">"myextension"</span><span class="p">:</span><span class="w"> </span><span class="s2">"My Extension"</span><span class="p">,</span> <span class="w"> </span><span class="nt">"myextension-desc"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Adds the MyExtension functionality."</span><span class="p">,</span> <span class="w"> </span><span class="nt">"myextension-summary"</span><span class="p">:</span><span class="w"> </span><span class="s2">"On this special page, do this simple thing and earn wonders"</span><span class="p">,</span> <span class="w"> </span><span class="nt">"specialpages-group-gamification"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Gamification"</span> <span class="p">}</span> </pre></div> <p>Now, assuming you set the return value for the method <code>SpecialPage::getGroupName()</code> as <code>gamification</code> in your class definition, reload <a href="/wiki/Special:SpecialPages" title="Special:SpecialPages">Special:SpecialPages</a> to see your new category. </p> <div class="mw-heading mw-heading2"><h2 id="Other_Important_Files">Other Important Files</h2></div> <div class="mw-heading mw-heading3"><h3 id="SpecialPage.php">SpecialPage.php</h3></div> <div class="mw-heading mw-heading4"><h4 id="Constructor">Constructor</h4></div> <p>You can <a href="https://en.wikipedia.org/wiki/Method_overloading" class="extiw" title="w:Method overloading">overload</a> the constructor to initialize your own data, but the main reason you would want to do it is to change the behavior of the SpecialPage class itself. When you call the base class constructor from your child class, the following parameters are available: </p> <div class="mw-highlight mw-highlight-lang-php mw-content-ltr" dir="ltr"><pre><span></span><span class="k">function</span> <span class="fm">__construct</span><span class="p">(</span> <span class="nv">$name</span> <span class="o">=</span> <span class="s1">''</span><span class="p">,</span> <span class="nv">$restriction</span> <span class="o">=</span> <span class="s1">''</span><span class="p">,</span> <span class="nv">$listed</span> <span class="o">=</span> <span class="k">true</span> <span class="p">);</span> </pre></div> <ul><li><i>string</i> <code>$name</code> Name of the special page, as seen in links and URLs</li> <li><i>string</i> <code>$restriction</code> <a href="/wiki/Special:MyLanguage/Manual:User_rights" title="Special:MyLanguage/Manual:User rights">User right</a> required, e.g. "block" or "delete"; also see <a href="/wiki/Special:MyLanguage/Manual:Special_pages#Restricting_page_access" title="Special:MyLanguage/Manual:Special pages">Restricting page access</a></li> <li><i>boolean</i> <code>$listed</code> Whether the page is listed in Special:Specialpages</li></ul> <div class="mw-heading mw-heading4"><h4 id="SpecialPage->setHeaders()"><span id="SpecialPage-.3EsetHeaders.28.29"></span><code>SpecialPage->setHeaders()</code></h4></div> <p>This initialises the OutputPage object <code>$wgOut</code> with the name and description of your special page. It should always be called from your <code>execute()</code> method. </p> <div class="mw-heading mw-heading4"><h4 id="SpecialPage->getOutput()"><span id="SpecialPage-.3EgetOutput.28.29"></span><code>SpecialPage->getOutput()</code></h4></div> <p>This method returns an OutputPage object which can be accessed as described below. As in the example code, use </p> <div class="mw-highlight mw-highlight-lang-php mw-content-ltr" dir="ltr"><pre><span></span><span class="nv">$output</span> <span class="o">=</span> <span class="nv">$this</span><span class="o">-></span><span class="na">getOutput</span><span class="p">();</span> <span class="nv">$output</span><span class="o">-></span><span class="na">addWikiTextAsInterface</span><span class="p">(</span> <span class="s1">'Hello, World'</span> <span class="p">);</span> </pre></div> <p>instead of the deprecated <code>$wgOut</code> global variable </p> <div class="mw-heading mw-heading4"><h4 id="SpecialPage->getRequest()"><span id="SpecialPage-.3EgetRequest.28.29"></span><code>SpecialPage->getRequest()</code></h4></div> <p>This method returns a WebRequest object which can be accessed as described below. As in the example code, use </p> <div class="mw-highlight mw-highlight-lang-php mw-content-ltr" dir="ltr"><pre><span></span><span class="nv">$request</span> <span class="o">=</span> <span class="nv">$this</span><span class="o">-></span><span class="na">getRequest</span><span class="p">();</span> <span class="nv">$myparam</span> <span class="o">=</span> <span class="nv">$request</span><span class="o">-></span><span class="na">getText</span><span class="p">(</span> <span class="s1">'myparam'</span> <span class="p">);</span> </pre></div> <p>instead of the deprecated <code><a href="/wiki/Special:MyLanguage/Manual:$wgRequest" title="Special:MyLanguage/Manual:$wgRequest">$wgRequest</a><span style="display:none"><a href="/wiki/Manual:$wgRequest" title="Manual:$wgRequest"> </a></span></code> global variable </p> <div class="mw-heading mw-heading4"><h4 id="SpecialPage->including()"><span id="SpecialPage-.3Eincluding.28.29"></span><code>SpecialPage->including()</code></h4></div> <p>Some special pages can be included from within another page. For example, if you add {{Special:RecentChanges}} to the wikitext of a page, it will insert a listing of recent changes within the existing content of the page. </p><p>Including a special page from another web page is only possible if you declared the page to be includable in the constructor. You can do this by adding the following in the <code>__construct()</code> method after the parent class initialization: </p> <div class="mw-highlight mw-highlight-lang-php mw-content-ltr" dir="ltr"><pre><span></span><span class="nv">$this</span><span class="o">-></span><span class="na">mIncludable</span> <span class="o">=</span> <span class="k">true</span><span class="p">;</span> </pre></div> <p>You can also define your special page class as extending the IncludableSpecialPage class. </p><p>The <code class="mw-highlight mw-highlight-lang-php mw-content-ltr" style="" dir="ltr"><span class="nx">SpecialPage</span><span class="o">-></span><span class="na">including</span><span class="p">()</span></code> function returns a boolean value telling you what context the special page is being called from: false if it is a separate web page, and true if it is being included from within another web page. Usually you will want to strip down the presentation somewhat if the page is being included. </p><p><span class="anchor" id="execute"></span> </p> <div class="mw-heading mw-heading4"><h4 id="SpecialPage->execute()"><span id="SpecialPage-.3Eexecute.28.29"></span><code>SpecialPage->execute()</code></h4></div> <p>This is the function which your child class should overload. It passes a single parameter, usually referred to cryptically as <code>$par</code> (short for $parameter, as it is the parameter the users can feed to your special page). This parameter is the subpage component of the current title. For example, if someone follows a link to <a href="/wiki/Special:MyExtension/blah" class="new" title="Special:MyExtension/blah (page does not exist)">Special:MyExtension/blah</a>, <code>$par</code> will contain "blah". </p> <div class="mw-heading mw-heading5"><h5 id="Help_page">Help page</h5></div> <style data-mw-deduplicate="TemplateStyles:r4199130">.mw-parser-output .mw-version{border:1px solid #72777d;font-size:80%;line-height:1.2;border-collapse:collapse}.mw-parser-output .mw-version-ltr{float:right;margin:0 0 .5em .5em;text-align:right}.mw-parser-output .mw-version-rtl{float:left;margin:0 .5em .5em 0;text-align:left}.mw-parser-output .mw-version td{padding:.1em .3em}.mw-parser-output .mw-version-versionbox{border:5px solid #00af89;text-align:center}.mw-parser-output .mw-version-versionnumber{font-weight:bold;font-size:180%}.mw-parser-output .mw-version-version .mw-version-versionbox{border-color:#c8ccd1}.mw-parser-output .mw-version.mw-version-version2 .mw-version-versionbox{border-top-color:#c8ccd1;border-right-color:#c8ccd1;border-left-color:#c8ccd1}.mw-parser-output .mw-version-version-unsupported .mw-version-versionbox{border-color:#d33}.mw-parser-output .mw-version.mw-version-version2-unsupported .mw-version-versionbox{border-top-color:#d33;border-right-color:#d33;border-left-color:#d33}.mw-parser-output .mw-version-version-legacy .mw-version-versionbox{border-color:#f93}.mw-parser-output .mw-version.mw-version-version2-legacy .mw-version-versionbox{border-top-color:#f93;border-right-color:#f93;border-left-color:#f93}.mw-parser-output .mw-version-version-stable .mw-version-versionbox,.mw-parser-output .mw-version.mw-version.mw-version-and-later .mw-version-versionbox{border-color:#00af89}.mw-parser-output .mw-version.mw-version-version2-stable .mw-version-versionbox{border-top-color:#00af89;border-right-color:#00af89;border-left-color:#00af89}.mw-parser-output .mw-version-version-future .mw-version-versionbox{border-color:#8080c0}.mw-parser-output .mw-version.mw-version-version2-future .mw-version-versionbox{border-top-color:#8080c0;border-right-color:#8080c0;border-left-color:#8080c0}.mw-parser-output .mw-version-version-alpha .mw-version-versionbox{border-style:dotted}</style> <table class="mw-version mw-version-ltr mw-version-version mw-version-version-unsupported mw-version-and-later"><tbody><tr> <td>MediaWiki version:</td> <td class="mw-version-versionbox" title="The latest stable version is 1.42"><div class="mw-version-versionnumber"><small>≥</small> 1.25</div></td> </tr></tbody></table> <p>It's useful to add <a href="/wiki/Special:MyLanguage/Project:PD_help" title="Special:MyLanguage/Project:PD help">help pages</a> on MediaWiki.org, where they'll be <a href="/wiki/Special:MyLanguage/Project:Language_policy" title="Special:MyLanguage/Project:Language policy">translatable</a>. To make sure users find your help page, it's advisable and very simple for your special page to link the help page in question: </p> <div class="mw-highlight mw-highlight-lang-php mw-content-ltr" dir="ltr"><pre><span></span><span class="nv">$this</span><span class="o">-></span><span class="na">addHelpLink</span><span class="p">(</span> <span class="s1">'Help:Extension:MyExtension'</span> <span class="p">);</span> </pre></div> <div class="mw-heading mw-heading3"><h3 id="OutputPage.php">OutputPage.php</h3></div> <p>OutputPage.php contains the class definition for objects of type <code>OutputPage</code>. You can get an object of this class from your SpecialPage using </p> <div class="mw-highlight mw-highlight-lang-php mw-content-ltr" dir="ltr"><pre><span></span><span class="nv">$output</span> <span class="o">=</span> <span class="nv">$this</span><span class="o">-></span><span class="na">getOutput</span><span class="p">();</span> </pre></div> <p>The variablename $output is, of course, arbitrary. Whatever you call it, this is the variable you will use the most, because it is the way to send output to the browser (no, you don't use <code>echo</code> or <code>print</code>). If you want to use it somewhere, create the variable and then use it: </p> <div class="mw-highlight mw-highlight-lang-php mw-content-ltr" dir="ltr"><pre><span></span><span class="k">function</span> <span class="nf">randomFunction</span><span class="p">()</span> <span class="p">{</span> <span class="nv">$output</span> <span class="o">=</span> <span class="nv">$this</span><span class="o">-></span><span class="na">getOutput</span><span class="p">();</span> <span class="nv">$output</span><span class="o">-></span><span class="na">addHTML</span><span class="p">(</span> <span class="s1">'<b>This is not a pipe...</b>'</span> <span class="p">);</span> <span class="p">}</span> </pre></div> <p>If you want to, you can create multiple OutputPage objects in different methods in your SpecialPage extension. They will add to the output in the order they are executed. </p><p>You can inspect the OutputPage class by viewing <code><a href="/wiki/Special:MyLanguage/Manual:OutputPage.php" title="Special:MyLanguage/Manual:OutputPage.php">includes/OutputPage.php</a><span style="display:none"><a href="/wiki/Manual:OutputPage.php" title="Manual:OutputPage.php"> </a></span></code> (indeed, all of these can be inspected), but there are a few methods you should definitely know about. </p> <div class="mw-heading mw-heading4"><h4 id="OutputPage->addHTML()"><span id="OutputPage-.3EaddHTML.28.29"></span><code>OutputPage->addHTML()</code></h4></div> <p>Essentially the quick and dirty substitute for <code>echo</code>. It takes your input and adds it to the buffer: no questions asked. In the below action, if <code>$action</code> contains user-data, it could easily have XSS, evil stuff, or the spawn of <a href="https://en.wikipedia.org/wiki/Satan" class="extiw" title="w:Satan">Satan</a> injected in. You're better off using escaping (such as with the php function htmlentities) or the XML builders class to build trusted output. </p> <div class="mw-highlight mw-highlight-lang-php mw-content-ltr" dir="ltr"><pre><span></span><span class="nv">$output</span><span class="o">-></span><span class="na">addHTML</span><span class="p">(</span> <span class="s1">'<form action="'</span><span class="o">.</span><span class="nv">$action</span><span class="o">.</span><span class="s1">'" method="post">'</span> <span class="p">);</span> </pre></div> <div class="mw-heading mw-heading4"><h4 id="OutputPage->addWikiText()"><span id="OutputPage-.3EaddWikiText.28.29"></span><code>OutputPage->addWikiText()</code></h4></div> <p>For most output, you should be using this function. It's a bit of a black magic function: wikitext goes in, HTML comes out, and a whole lotta arcane code and demon summonings happen in between. </p> <div class="mw-highlight mw-highlight-lang-php mw-content-ltr" dir="ltr"><pre><span></span><span class="nv">$output</span><span class="o">-></span><span class="na">addWikiText</span><span class="p">(</span><span class="s2">"This is some ''lovely'' [[wikitext]] that will '''get''' parsed nicely."</span><span class="p">);</span> </pre></div> <p>What's worth noting is that the parser will view your chunks as cohesive wholes and paragraph accordingly. That is... </p> <div class="mw-highlight mw-highlight-lang-php mw-content-ltr" dir="ltr"><pre><span></span><span class="nv">$output</span><span class="o">-></span><span class="na">addWikiText</span><span class="p">(</span> <span class="s1">'* Item 1'</span> <span class="p">);</span> <span class="nv">$output</span><span class="o">-></span><span class="na">addWikiText</span><span class="p">(</span> <span class="s1">'* Item 2'</span> <span class="p">);</span> <span class="nv">$output</span><span class="o">-></span><span class="na">addWikiText</span><span class="p">(</span> <span class="s1">'* Item 3'</span> <span class="p">);</span> </pre></div> <p>Will output three lists with one item each, which probably wasn't intended. </p><p>Note however, if you just want to insert a system message and have it treated like parsed wikitext, you can use code like <code class="mw-highlight mw-highlight-lang-php mw-content-ltr" style="" dir="ltr"><span class="nv">$this</span><span class="o">-></span><span class="na">getOutput</span><span class="p">()</span><span class="o">-></span><span class="na">addHtml</span><span class="p">(</span> <span class="nv">$this</span><span class="o">-></span><span class="na">msg</span><span class="p">(</span> <span class="s1">'key-of-message'</span> <span class="p">)</span><span class="o">-></span><span class="na">parse</span><span class="p">()</span> <span class="p">)</span></code>. This will not have the issue with nested parser calls mentioned above. </p> <div class="mw-heading mw-heading4"><h4 id="OutputPage->showErrorPage()"><span id="OutputPage-.3EshowErrorPage.28.29"></span><code>OutputPage->showErrorPage()</code></h4></div> <p>An error page is shown. The arguments <code>$title</code> and <code>$msg</code> specify keys into $this->msg(), not text. An example: </p> <div class="mw-highlight mw-highlight-lang-php mw-content-ltr" dir="ltr"><pre><span></span><span class="nv">$output</span><span class="o">-></span><span class="na">showErrorPage</span><span class="p">(</span> <span class="s1">'error'</span><span class="p">,</span> <span class="s1">'badarticleerror'</span> <span class="p">);</span> </pre></div> <ul><li>'error' refers to the text <i>"Error"</i>.</li> <li>'badarticleerror' refers to the text <i>"This action cannot be performed on this page."</i>.</li></ul> <p>You can also specify message objects or add parameters: </p> <div class="mw-highlight mw-highlight-lang-php mw-content-ltr" dir="ltr"><pre><span></span><span class="nv">$output</span><span class="o">-></span><span class="na">showErrorPage</span><span class="p">(</span> <span class="s1">'error'</span><span class="p">,</span> <span class="s1">'badarticleerror'</span><span class="p">,</span> <span class="p">[</span> <span class="s1">'param1'</span><span class="p">,</span> <span class="s1">'param2'</span> <span class="p">]</span> <span class="p">);</span> </pre></div> <div class="mw-highlight mw-highlight-lang-php mw-content-ltr" dir="ltr"><pre><span></span><span class="nv">$messageObject</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Message</span><span class="p">(</span><span class="o">...</span><span class="p">);</span> <span class="o">...</span> <span class="nv">$output</span><span class="o">-></span><span class="na">showErrorPage</span><span class="p">(</span> <span class="s1">'error'</span><span class="p">,</span> <span class="nv">$messageObject</span> <span class="p">);</span> </pre></div> <div class="mw-highlight mw-highlight-lang-php mw-content-ltr" dir="ltr"><pre><span></span><span class="nv">$titleMessageObject</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Message</span><span class="p">(</span><span class="o">...</span><span class="p">);</span> <span class="nv">$messageObject</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Message</span><span class="p">(</span><span class="o">...</span><span class="p">);</span> <span class="o">...</span> <span class="nv">$output</span><span class="o">-></span><span class="na">showErrorPage</span><span class="p">(</span> <span class="nv">$titleMessageObject</span><span class="p">,</span> <span class="nv">$messageObject</span> <span class="p">);</span> </pre></div> <div class="mw-heading mw-heading3"><h3 id="WebRequest.php">WebRequest.php</h3></div> <p>The <a href="/wiki/Special:MyLanguage/Manual:WebRequest.php" title="Special:MyLanguage/Manual:WebRequest.php">WebRequest</a> class is used to obtain information from the GET and POST arrays. Using this is recommended over directly accessing the superglobals. The WebRequest object is accessible from extensions by using the <a href="/wiki/Special:MyLanguage/RequestContext" title="Special:MyLanguage/RequestContext">RequestContext</a><span style="display:none"><a href="/wiki/RequestContext" class="mw-redirect" title="RequestContext"> </a></span>. </p> <div class="mw-heading mw-heading3"><h3 id="Database.php">Database.php</h3></div> <p>MediaWiki has a load of convenience functions and wrappers for interacting with the database, using the <a href="/wiki/Special:MyLanguage/Manual:Database.php" title="Special:MyLanguage/Manual:Database.php">\Wikimedia\Rdbms\Database</a> class. It also has an interesting load balancing scheme in place. It's recommended you use these wrappers. Check out <code><a href="/wiki/Special:MyLanguage/Manual:Database.php" title="Special:MyLanguage/Manual:Database.php">Database.php</a><span style="display:none"><a href="/wiki/Manual:Database.php" title="Manual:Database.php"> </a></span></code> for a complete listing of all the convenience functions, because these docs will only tell you about the non-obvious caveats. See <a href="/wiki/Special:MyLanguage/Manual:Database_access" title="Special:MyLanguage/Manual:Database access">Manual:Database access</a><span style="display:none"><a href="/wiki/Manual:Database_access" title="Manual:Database access"> </a></span>. </p> <div class="mw-heading mw-heading3"><h3 id="User.php">User.php</h3></div> <p>The <a href="/wiki/Special:MyLanguage/Manual:User.php" title="Special:MyLanguage/Manual:User.php">User</a> class is used to represent users on the system. SpecialPage->getUser() should be used to obtain a User object for the currently logged in user. The use of the global <code>$wgUser</code> is deprecated </p> <div class="mw-heading mw-heading3"><h3 id="Title.php">Title.php</h3></div> <p>Title represents the name of a page in the wiki. This is useful because MediaWiki does all sorts of fun escaping and special case logic to page names, so instead of rolling your own convert title to URL function, you create a Title object with your page name, and then use <code>getLocalURL()</code> to get a URL to that page. </p><p>To get a title object for your special page from outside of the special page class, you can use <code class="mw-highlight mw-highlight-lang-php mw-content-ltr" style="" dir="ltr"><span class="nx">SpecialPage</span><span class="o">::</span><span class="na">getTitleFor</span><span class="p">(</span> <span class="s1">'YourCanonicalSpecialPageName'</span> <span class="p">)</span></code>. It will give you a localised title in the wiki's language. </p> <div class="mw-heading mw-heading2"><h2 id="Custom_special_pages">Custom special pages</h2></div> <p>There are various ways to provide your own special pages not bundled within MediaWiki: </p> <ul><li>One method is to install an extension that generates a form to create or edit an article. A list of extensions currently available, can be found at <a href="/wiki/Special:MyLanguage/Category:Special_page_extensions" title="Special:MyLanguage/Category:Special page extensions">Category:Special page extensions</a><span style="display:none"><a href="/wiki/Category:Special_page_extensions" title="Category:Special page extensions"> </a></span>.</li> <li>You can also write an extension which provides your own special page. Writing your own extension requires <a href="https://en.wikipedia.org/wiki/PHP" class="extiw" title="w:PHP">PHP</a> coding skill and comfort with object oriented design and databases also is helpful. You will also need to know how to use code to create and edit MediaWiki articles. For more information, please see <a href="/wiki/Special:MyLanguage/Manual:Forms#Articles_with_embedded_forms" title="Special:MyLanguage/Manual:Forms">this discussion</a>.</li> <li>You can also display a custom page through JavaScript, in place of the default error message "Unknown special page" (or the "This page is intentionally left blank." message, if using a subpage of <a href="/wiki/Special:BlankPage" title="Special:BlankPage">Special:BlankPage</a>). In MediaWiki:Common.js, check for <a href="/wiki/Special:MyLanguage/Manual:Interface/JavaScript#mw.config" title="Special:MyLanguage/Manual:Interface/JavaScript">wgPageName</a><span style="display:none"><a href="/wiki/Manual:Interface/JavaScript#mw.config" title="Manual:Interface/JavaScript"> </a></span>, then hide the MediaWiki-generated content (just appendCSS <code>{visibility:hidden;}</code> ), and inject custom HTML (<code>innerHTML</code>) into the <code>document.getElementById('bodyContent')</code> or <code>document.getElementById('mw_contentholder')</code>. For an example, see <a href="https://meta.wikimedia.org/wiki/User:Krinkle/Tools/Real-Time_Recent_Changes" class="extiw" title="meta:User:Krinkle/Tools/Real-Time Recent Changes">meta:User:Krinkle/Tools/Real-Time Recent Changes</a>.</li></ul> <div class="mw-heading mw-heading2"><h2 id="FAQ">FAQ</h2></div> <div class="mw-heading mw-heading3"><h3 id="Setting_an_Extension_Title">Setting an Extension Title</h3></div> <p>MediaWiki does not set the title of the extension, which is the developer's job. It will look for the name of the extension when <a href="/wiki/Special:SpecialPages" title="Special:SpecialPages">Special:Specialpages</a> is called or the special page is loaded. In the <a href="#execute"><i>function execute( $par )</i></a> section, use OutputPage methods to title the extension like: <code class="mw-highlight mw-highlight-lang-php mw-content-ltr" style="" dir="ltr"><span class="nv">$this</span><span class="o">-></span><span class="na">getOutput</span><span class="p">()</span><span class="o">-></span><span class="na">setPageTitle</span><span class="p">(</span><span class="s2">"your title"</span><span class="p">);</span></code> </p><p>The place where the extension can be found (as specified by what is passed into the SpecialPage constructor) is the key--<b>except</b> that it is not capitalized because of <code>getDescription()</code>, the internally used function that finds out the title (or, what they call description) of the special page, <code>strtolower</code> the name. "ThisIsACoolSpecialPage"'s key would be "thisisacoolspecialpage." </p><p>Theoretically, <code>getDescription</code> can be overloaded in order to avoid interacting with the message cache but, as the source code states: "Derived classes can override this, but usually it is easier to keep the default behavior. Furthermore, this prevents the MediaWiki namespace from overloading the message, as below. </p> <div class="mw-heading mw-heading3"><h3 id="Localizing_the_Extension_Name">Localizing the Extension Name</h3></div> <p>So you've just installed a shiny new MediaWiki extension and realize: "Oh no, my wiki is in French, but the page is showing up as English!" Most people wouldn't care, but it's actually a quite simple task to fix (as long as the developer used the method explained on this page). No noodling around in source code. Let's say the name of the page is <code>DirtyPages</code> and the name comes out to "List of Dirty Pages" but you want it to be (and <a href="https://en.wikipedia.org/wiki/Pardon_my_French" class="extiw" title="w:Pardon my French">excuse my poor French</a>) "Liste de Pages Sales". Well, it's as simple as this: </p> <ol><li>Navigate to <a href="/w/index.php?title=MediaWiki:DirtyPages&action=edit&redlink=1" class="new" title="MediaWiki:DirtyPages (page does not exist)">MediaWiki:DirtyPages</a>, this page may not exist, but edit it anyway</li> <li>Insert "Liste de Pages Sales" and save</li></ol> <p>And <i>voilà</i> (pardon the pun), the change is applied. </p><p>This is also useful for customizing the title for your wiki within your language: for instance, the developer called it "List of Dirty Pages" but you don't like that name, so you rename it "List of Pages needing Cleanup". Check out <a href="/wiki/Special:AllMessages" title="Special:AllMessages">Special:Allmessages</a> to learn more. </p><p>Also, if your extension has a large block of text that does change, like a warning, don't directly output the text. Instead, add it to the message cache and when the time comes to output the text in your code, do this: </p> <div class="mw-highlight mw-highlight-lang-php mw-content-ltr" dir="ltr"><pre><span></span><span class="nv">$wgOut</span><span class="o">-></span><span class="na">addWikiText</span><span class="p">(</span> <span class="nv">$this</span><span class="o">-></span><span class="na">msg</span><span class="p">(</span> <span class="s1">'dirtypageshelp'</span> <span class="p">)</span> <span class="p">);</span> </pre></div> <p>Then this message too can be customized at <a href="/w/index.php?title=MediaWiki:Dirtypageshelp&action=edit&redlink=1" class="new" title="MediaWiki:Dirtypageshelp (page does not exist)">MediaWiki:Dirtypageshelp</a>. </p><p>See also <a href="/wiki/Special:MyLanguage/Help:System_message" title="Special:MyLanguage/Help:System message">Help:System message</a><span style="display:none"><a href="/wiki/Help:System_message" title="Help:System message"> </a></span>. </p> <div class="mw-heading mw-heading3"><h3 id="Restricting_page_access">Restricting page access</h3></div> <div class="mw-heading mw-heading4"><h4 id="Do_not_display_your_Special_Page_on_Special:SpecialPages">Do not display your Special Page on <a href="/wiki/Special:SpecialPages" title="Special:SpecialPages">Special:SpecialPages</a></h4></div> <p>Sometimes you may want to limit the visibility of your Special Page by removing it from <a href="/wiki/Special:SpecialPages" title="Special:SpecialPages">Special:SpecialPages</a> and making it visible to only those users with a particular right. You can do this in the <a href="#Constructor">constructor</a> by passing in a <code>$restriction</code> parameter; e.g., “editinterface”, a right only assigned to sysops by default; see the <a href="/wiki/Special:MyLanguage/Manual:User_rights" title="Special:MyLanguage/Manual:User rights">User rights manual</a> for other available user rights. </p> <div class="mw-highlight mw-highlight-lang-php mw-content-ltr" dir="ltr"><pre><span></span><span class="k">function</span> <span class="fm">__construct</span><span class="p">()</span> <span class="p">{</span> <span class="k">parent</span><span class="o">::</span><span class="na">__construct</span><span class="p">(</span> <span class="s1">'MyExtension'</span><span class="p">,</span> <span class="s1">'editinterface'</span> <span class="p">);</span> <span class="c1">// restrict to sysops</span> <span class="p">}</span> </pre></div> <p>Or you can create your own right in <a href="#The_setup_file">the setup file</a> and assign it to sysops, e.g.: </p> <div class="mw-highlight mw-highlight-lang-json mw-content-ltr" dir="ltr"><pre><span></span><span class="nt">"AvailableRights"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span> <span class="w"> </span><span class="s2">"myextension-right"</span> <span class="p">],</span> <span class="nt">"GroupPermissions"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="nt">"sysop"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="nt">"myextension-right"</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span> <span class="w"> </span><span class="p">}</span> <span class="p">}</span> </pre></div> <p>and then call the constructor with your right: </p> <div class="mw-highlight mw-highlight-lang-php mw-content-ltr" dir="ltr"><pre><span></span><span class="k">function</span> <span class="fm">__construct</span><span class="p">()</span> <span class="p">{</span> <span class="k">parent</span><span class="o">::</span><span class="na">__construct</span><span class="p">(</span> <span class="s1">'MyExtension'</span><span class="p">,</span> <span class="s1">'myextension-right'</span> <span class="p">);</span> <span class="p">}</span> </pre></div> <div class="mw-heading mw-heading4"><h4 id="Prevent_access_to_your_Special_Page">Prevent access to your Special Page</h4></div> <p>Even if you restrict your page in the constructor, as mentioned above, it will still be viewable directly via the URL, e.g. at Special:MySpecialPage. In order to actually limit access to your SpecialPage you must call <code class="mw-highlight mw-highlight-lang-php mw-content-ltr" style="" dir="ltr"><span class="nv">$this</span><span class="o">-></span><span class="na">checkPermissions</span><span class="p">()</span></code> in the <code>execute</code> method. </p><p>If you need more fine-grained control over permissions, you can override <code class="mw-highlight mw-highlight-lang-php mw-content-ltr" style="" dir="ltr"><span class="nv">$this</span><span class="o">-></span><span class="na">checkPermissions</span><span class="p">()</span></code>, and/or add whatever permissions-checking is required for your extension. </p> <div class="mw-heading mw-heading3"><h3 id="Disabling_Special:UserLogin_and_Special:UserLogout_pages">Disabling Special:UserLogin and Special:UserLogout pages</h3></div> <p>In LocalSettings.php you can use the <a href="/wiki/Special:MyLanguage/Manual:Hooks/SpecialPage_initList" title="Special:MyLanguage/Manual:Hooks/SpecialPage initList">SpecialPage_initList hook</a><span style="display:none"><a href="/wiki/Manual:Hooks/SpecialPage_initList" title="Manual:Hooks/SpecialPage initList"> </a></span> to <i>unset</i> unwanted built-in special pages. See <a href="https://lists.wikimedia.org/pipermail/mediawiki-l/2009-June/031231.html" class="extiw" title="mailarchive:mediawiki-l/2009-June/031231.html">"making a few SpecialPages restricted"</a> if you need <i>conditional</i> unsetting of special pages for example for certain user groups. The general message "You have requested an invalid special page." is shown if users try to access such unset special pages. </p> <div class="mw-highlight mw-highlight-lang-php mw-content-ltr" dir="ltr"><pre><span></span><span class="nv">$wgHooks</span><span class="p">[</span><span class="s1">'SpecialPage_initList'</span><span class="p">][]</span> <span class="o">=</span> <span class="k">function</span> <span class="p">(</span> <span class="o">&</span><span class="nv">$list</span> <span class="p">)</span> <span class="p">{</span> <span class="nb">unset</span><span class="p">(</span> <span class="nv">$list</span><span class="p">[</span><span class="s1">'Userlogout'</span><span class="p">]</span> <span class="p">);</span> <span class="nb">unset</span><span class="p">(</span> <span class="nv">$list</span><span class="p">[</span><span class="s1">'Userlogin'</span><span class="p">]</span> <span class="p">);</span> <span class="k">return</span> <span class="k">true</span><span class="p">;</span> <span class="p">};</span> </pre></div> <p>A different approach would be to use the DisabledSpecialPage callback. This approach may be preferred if you're only disabling the special page "temporarily", because the default message in this case would say: "This page has been disabled by a system administrator." instead of pretending the page does not exist at all. This gives clear hint that the page maybe activated at a later time. </p> <div class="mw-highlight mw-highlight-lang-php mw-content-ltr" dir="ltr"><pre><span></span><span class="nv">$wgSpecialPages</span><span class="p">[</span><span class="s1">'Userlogout'</span><span class="p">]</span> <span class="o">=</span> <span class="nx">DisabledSpecialPage</span><span class="o">::</span><span class="na">getCallback</span><span class="p">(</span> <span class="s1">'Userlogout'</span> <span class="p">);</span> <span class="nv">$wgSpecialPages</span><span class="p">[</span><span class="s1">'Userlogin'</span><span class="p">]</span> <span class="o">=</span> <span class="nx">DisabledSpecialPage</span><span class="o">::</span><span class="na">getCallback</span><span class="p">(</span> <span class="s1">'Userlogin'</span> <span class="p">);</span> </pre></div> <p>It is also possible to add custom lengthy explanation of why you're disabling the special page, by giving a message key as the second argument of the callback. To do so first create a system message "MediaWiki:Userlogout-disable-reason" and write all the explanation there. The message will be parsed in a block format. Then in LocalSettings.php add: </p> <div class="mw-highlight mw-highlight-lang-php mw-content-ltr" dir="ltr"><pre><span></span><span class="nv">$wgSpecialPages</span><span class="p">[</span><span class="s1">'Userlogout'</span><span class="p">]</span> <span class="o">=</span> <span class="nx">DisabledSpecialPage</span><span class="o">::</span><span class="na">getCallback</span><span class="p">(</span> <span class="s1">'Userlogout'</span><span class="p">,</span> <span class="s1">'Userlogout-disable-reason'</span> <span class="p">);</span> </pre></div> <div class="mw-heading mw-heading3"><h3 id="Adding_logs">Adding logs</h3></div> <p>On MediaWiki, all actions by users on wiki are tracked for transparency and collaboration. See <a href="/wiki/Special:MyLanguage/Manual:Logging_to_Special:Log" title="Special:MyLanguage/Manual:Logging to Special:Log">Manual:Logging to Special:Log</a><span style="display:none"><a href="/wiki/Manual:Logging_to_Special:Log" title="Manual:Logging to Special:Log"> </a></span> for how to do it. </p> <div class="mw-heading mw-heading3"><h3 id="Changing_the_groups_on_Special:Specialpages">Changing the groups on <a href="/wiki/Special:SpecialPages" title="Special:SpecialPages">Special:Specialpages</a></h3></div> <p>If you're an extension developer, you have to implement the <code>getGroupName()</code> method as described in <a href="#Special_page_group">the Special page group section</a> of this page. </p><p>Since MediaWiki 1.21, the special page group can be overridden by editing a <a href="/wiki/Special:MyLanguage/Help:System_message" title="Special:MyLanguage/Help:System message">system message</a>. This method is not intended to be used by extension developers, but by site admins. The group name must be placed in the <code>specialpages-specialpagegroup-<special page name></code> message, where <code><special page name></code> is the canonical name (in english) of the special page in lowercase. For example, if you want to set the group under which <code>Special:MyLittlePage</code> is displayed on <a href="/wiki/Special:SpecialPages" title="Special:SpecialPages">Special:Specialpages</a> to <code>MyLittleGroup</code>, you just have to create <code>MediaWiki:Specialpages-specialpagegroup-mylittlepage</code> with content <code>MyLittleGroup</code>. <code>Special:MyLittlePage</code> will then show up under the group <code>MyLittleGroup</code>, which you can name under <code>MediaWiki:Specialpages-group-mylittlegroup</code>. </p><p>If you want to change the group of existing special pages, have a look on <a class="external text" href="https://www.mediawiki.org/w/index.php?title=Special:SpecialPages&uselang=qqx">Special:SpecialPages&uselang=qqx</a> and use those names instead of "mylittlepage". </p> <div class="mw-heading mw-heading3"><h3 id="Unlisting_the_page_from_Special:Specialpages">Unlisting the page from <a href="/wiki/Special:SpecialPages" title="Special:SpecialPages">Special:Specialpages</a></h3></div> <p>To remove a special page from the <a href="/wiki/Special:SpecialPages" title="Special:SpecialPages">Special:Specialpages</a> altogether, pass a <code class="mw-highlight mw-highlight-lang-php mw-content-ltr" style="" dir="ltr"><span class="k">false</span></code> as a third parameter to the SpecialPage parent constructor, as described in <a href="#Constructor">the SpecialPage Constructor section</a> of this page. If you need more complicated logic to determine whether the page should be listed or not, you can also override the <code>isListed()</code> function, but using the constructor parameter is simpler. </p> <div class="mw-heading mw-heading3"><h3 id="Getting_a_list_of_special_pages_and_their_aliases_on_a_wiki">Getting a list of special pages and their aliases on a wiki</h3></div> <p>Simply use the "siteinfo" API module to retrieve the information from the wiki like e.g. <a class="external text" href="https://www.mediawiki.org/w/api.php?action=query&meta=siteinfo&siprop=specialpagealiases">/api.php?action=query&meta=siteinfo&siprop=specialpagealiases</a>. </p> <div class="mw-heading mw-heading2"><h2 id="See_also">See also</h2></div> <ul><li><a href="/wiki/Special:MyLanguage/HTMLForm" title="Special:MyLanguage/HTMLForm">HTMLForm</a> – Tutorial on creating checkboxes, text areas, radio buttons, etc. in special pages</li></ul> <!-- NewPP limit report Parsed by mw‐web.codfw.main‐78f4c97c5d‐qr7c2 Cached time: 20241129001813 Cache expiry: 2592000 Reduced expiry: false Complications: [show‐toc] CPU time usage: 0.492 seconds Real time usage: 0.675 seconds Preprocessor visited node count: 4023/1000000 Post‐expand include size: 28257/2097152 bytes Template argument size: 15074/2097152 bytes Highest expansion depth: 18/100 Expensive parser function count: 66/500 Unstrip recursion depth: 0/20 Unstrip post‐expand size: 44342/5000000 bytes Lua time usage: 0.076/10.000 seconds Lua memory usage: 2009039/52428800 bytes Number of Wikibase entities loaded: 0/400 --> <!-- Transclusion expansion time report (%,ms,calls,template) 100.00% 373.341 1 -total 40.80% 152.336 30 Template:Ll 28.15% 105.113 1 Template:ExtensionTypes 26.73% 99.777 1 Template:Nmbox 18.74% 69.950 60 Template:Translatable 15.68% 58.527 31 Template:Pagelang 13.38% 49.959 1 Template:Flatlist 10.65% 39.770 2 Template:Note 9.76% 36.429 1 Template:Ombox 8.66% 32.331 1 Template:MW_1.25 --> <!-- Saved in parser cache with key mediawikiwiki:pcache:15999:|#|:idhash:canonical and timestamp 20241129001813 and revision id 6804659. Rendering was triggered because: page-view --> </div><!--esi <esi:include src="/esitest-fa8a495983347898/content" /> --><noscript><img src="https://login.wikimedia.org/wiki/Special:CentralAutoLogin/start?useformat=desktop&type=1x1&usesul3=0" alt="" width="1" height="1" style="border: none; position: absolute;"></noscript> <div class="printfooter" data-nosnippet="">Retrieved from "<a dir="ltr" href="https://www.mediawiki.org/w/index.php?title=Manual:Special_pages&oldid=6804659">https://www.mediawiki.org/w/index.php?title=Manual:Special_pages&oldid=6804659</a>"</div></div> <div id="catlinks" class="catlinks" data-mw="interface"><div id="mw-normal-catlinks" class="mw-normal-catlinks"><a href="/wiki/Special:Categories" title="Special:Categories">Categories</a>: <ul><li><a href="/wiki/Category:MediaWiki_development" title="Category:MediaWiki development">MediaWiki development</a></li><li><a href="/wiki/Category:Customization_techniques" title="Category:Customization techniques">Customization techniques</a></li><li><a href="/wiki/Category:User_interface" title="Category:User interface">User interface</a></li><li><a href="/wiki/Category:Special_Pages" title="Category:Special Pages">Special Pages</a></li></ul></div></div> </div> </main> </div> <div class="mw-footer-container"> <footer id="footer" class="mw-footer" > <ul id="footer-info"> <li id="footer-info-lastmod"> This page was last edited on 20 October 2024, at 19:52.</li> <li id="footer-info-copyright">Text is available under the <a rel="nofollow" class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.en">Creative Commons Attribution-ShareAlike License</a>; additional terms may apply. Text in <a class="external text" href="https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents">the Help: namespace</a> is available under the <a rel="nofollow" class="external text" href="https://creativecommons.org/publicdomain/zero/1.0/">Creative Commons CC0 License</a>. By using this site, you agree to the <a class="external text" href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Terms_of_Use">Terms of Use</a> and <a class="external text" href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Privacy_policy">Privacy Policy</a>.</li> </ul> <ul id="footer-places"> <li id="footer-places-privacy"><a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Privacy_policy">Privacy policy</a></li> <li id="footer-places-about"><a href="/wiki/Project:About">About mediawiki.org</a></li> <li id="footer-places-disclaimers"><a href="/wiki/Project:General_disclaimer">Disclaimers</a></li> <li id="footer-places-wm-codeofconduct"><a href="https://www.mediawiki.org/wiki/Special:MyLanguage/Code_of_Conduct">Code of Conduct</a></li> <li id="footer-places-developers"><a href="https://developer.wikimedia.org">Developers</a></li> <li id="footer-places-statslink"><a href="https://stats.wikimedia.org/#/www.mediawiki.org">Statistics</a></li> <li id="footer-places-cookiestatement"><a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Cookie_statement">Cookie statement</a></li> <li id="footer-places-mobileview"><a href="//m.mediawiki.org/w/index.php?title=Manual:Special_pages&mobileaction=toggle_view_mobile" class="noprint stopMobileRedirectToggle">Mobile view</a></li> </ul> <ul id="footer-icons" class="noprint"> <li id="footer-copyrightico"><a href="https://wikimediafoundation.org/" class="cdx-button cdx-button--fake-button cdx-button--size-large cdx-button--fake-button--enabled"><img src="/static/images/footer/wikimedia-button.svg" width="84" height="29" alt="Wikimedia Foundation" loading="lazy"></a></li> <li id="footer-poweredbyico"><a href="https://www.mediawiki.org/" class="cdx-button cdx-button--fake-button cdx-button--size-large cdx-button--fake-button--enabled"><img src="/w/resources/assets/poweredby_mediawiki.svg" alt="Powered by MediaWiki" width="88" height="31" loading="lazy"></a></li> </ul> </footer> </div> </div> </div> <div class="vector-settings" id="p-dock-bottom"> <ul></ul> </div><script>(RLQ=window.RLQ||[]).push(function(){mw.config.set({"wgHostname":"mw-web.codfw.main-55db797859-j9z2m","wgBackendResponseTime":128,"wgPageParseReport":{"limitreport":{"cputime":"0.492","walltime":"0.675","ppvisitednodes":{"value":4023,"limit":1000000},"postexpandincludesize":{"value":28257,"limit":2097152},"templateargumentsize":{"value":15074,"limit":2097152},"expansiondepth":{"value":18,"limit":100},"expensivefunctioncount":{"value":66,"limit":500},"unstrip-depth":{"value":0,"limit":20},"unstrip-size":{"value":44342,"limit":5000000},"entityaccesscount":{"value":0,"limit":400},"timingprofile":["100.00% 373.341 1 -total"," 40.80% 152.336 30 Template:Ll"," 28.15% 105.113 1 Template:ExtensionTypes"," 26.73% 99.777 1 Template:Nmbox"," 18.74% 69.950 60 Template:Translatable"," 15.68% 58.527 31 Template:Pagelang"," 13.38% 49.959 1 Template:Flatlist"," 10.65% 39.770 2 Template:Note"," 9.76% 36.429 1 Template:Ombox"," 8.66% 32.331 1 Template:MW_1.25"]},"scribunto":{"limitreport-timeusage":{"value":"0.076","limit":"10.000"},"limitreport-memusage":{"value":2009039,"limit":52428800}},"cachereport":{"origin":"mw-web.codfw.main-78f4c97c5d-qr7c2","timestamp":"20241129001813","ttl":2592000,"transientcontent":false}}});});</script> </body> </html>