This page is apartial list of the parameters toindex.php, the main script of the MediaWiki software, as provided by MediaWiki itself.Most of these arguments are usually given as GET parameters in the URL, but can also be passed as POST data.POST is actually required in some cases, such as the purge action. Some extensions provide additional parameters.
Parameters to index.php usually apply and have a meaning related to the page they apply to.The page (or a version of it) can be specified by typing one or more of the following parameters:https://en.wikipedia.org/w/index.php?title=Ferengi&curid=177126&diff=304901009&oldid=304764764
| Name | Description |
|---|---|
| title | The title of the page.It can be a wiki page or aspecial page, depending on the other parameters.To disable a special page in your wiki configuration, you can use theSpecialPage_initList hook. |
| curid | The ID of the wiki page; overrides the value of title. |
Some actions (such as view and edit) also work on a particular revision of a page. Such a revision is identified by the following two parameters, allowing the omission of the title and the ID of the page.
| Name | Description |
|---|---|
| oldid | The ID of a revision |
| direction | Instead of the revision given byoldid, use:
|
The following is a list of values for theaction parameter.
Some of these actions can be enabled/disabled by using a dedicatedconfiguration setting inLocalSettings.php. Where available, these local settings are listed.[2]
| Name | Function | Example |
|---|---|---|
| view | View is the default action; view is the one action that is used when no action is explicitly given | www.mediawiki.org/w/index.php?title=Project:Sandbox&action=view |
| watch | Adds the page to the user's watchlist | www.mediawiki.org/w/index.php?title=Project:Sandbox&action=watch |
| unwatch | Removes the page from the user's watchlist | www.mediawiki.org/w/index.php?title=Project:Sandbox&action=unwatch |
| delete | Deletes a page By default, delete returns a form for the user to confirm deletion and specify a reason.[3] | www.mediawiki.org/w/index.php?title=Project:Sandbox&action=delete |
| revert | Reverts to a previous version of animage. The following two other parameters are required:
| |
| rollback | Rollbacks the last edits made by the last editor of the page; in other words, it restores the last version of the article whose editor is not the last one. The edit is marked as minor and a default edit summary is used.[4] The following two other parameters are required:
| www.mediawiki.org/w/index.php?title=Project:Sandbox&action=rollback&from=John&token=d7aaa6c\ |
| protect | Shows or changes the protection levels of a page:
| www.mediawiki.org/w/index.php?title=Project:Sandbox&action=protect |
| unprotect | Same page as protect (unprotect and protect are the same page, and do the same thing). | www.mediawiki.org/w/index.php?title=Project:Sandbox&action=unprotect |
| markpatrolled | Marks an edit as patrolled; seeHelp:Patrolled edit.
| |
| render | Outputs the HTML rendering of the entire page content; similar to theview action, but only the unstyled article text is output, not any part of the user interface (additional toolboxes, search box, stylesheets, etc.).For more stable programmatic access or to retrieve the HTML of only a piece of page content, you should use the parse API withpage orpageid parameters. | www.mediawiki.org/w/index.php?title=Project:Sandbox&action=render |
| purge | Clears the page's cache, forcing the page to be redisplayed from its source.
| www.mediawiki.org/w/index.php?title=Project:Sandbox&action=purge |
| edit | Yana nuna editan shafin. Editan da aka nuna ya dogara da zaɓin mai amfani.SeeEditor. | www.mediawiki.org/w/index.php?title=Project:Sandbox&action=edit |
| submit | Lokacin da aka duba kai tsaye (HTTP GET), yana nuna editan, kamar "gyara".
When viewing by submitting a form (HTTP POST), performs various actions related to changing the page (see#What to do below for more details):
| www.mediawiki.org/w/index.php?title=Project:Sandbox&action=submit |
| editredlink | Same asedit.[6] | www.mediawiki.org/w/index.php?title=Project:Sandbox&action=editredlink |
| history | Shows the history of the page. (See history, below) | www.mediawiki.org/w/index.php?title=Project:Sandbox&action=history |
| historysubmit | When viewing the difference between revisions, after clicking "compare selected revisions" on the history page. This requires a "diff" and/or "oldid" parameter, otherwise it just shows the page itself. | www.mediawiki.org/w/index.php?title=Project:Sandbox&action=historysubmit&diff=456290&oldid=456270 |
| raw | Shows the raw content of the page. (See Raw, below) A pop up window will open up, asking whether you would like to save the page in index.php.[7] | www.mediawiki.org/w/index.php?title=Project:Sandbox&action=raw |
| credits | Shows a list of people who contributed to the page in question using the real name specified in the user's preferences. Currently disabled on Wikimedia wikis, but is enabled by default on vanilla MediaWiki. | translatewiki.net/w/i.php?title=Translating:MediaWiki&action=credits |
| info | Shows information about the page, such as the number of users having it in their watchlist, the number of edits, the number of authors. See theReimplement info action RfC for context. | www.mediawiki.org/w/index.php?title=Project:Sandbox&action=info |
| revisiondelete | Set visibility restrictions on revision text, edit summary, and editor's username/IP address (requires deleterevision user right) |
The following parameters override some of the user'spreferences.Other parameters explained in other sections are "diffonly", "internaledit", and "externaledit". The below parameters affect all actions but "render" and "raw".
| Name | Function | Example |
|---|---|---|
| useskin | Specify askin | www.mediawiki.org/w/index.php?useskin=modern |
| uselang | Specify a language for the UI elements (such as the "my talk" link, etc.), i.e. theuser interface language; this is especially useful for creating an account, because at that stage no preference settings apply. The special language code " | www.mediawiki.org/w/index.php?title=Special:Userlogin&type=signup&uselang=de |
| variant | Specify a language variant for the UI elements (this is used for example in the Chinese Wikipedia, as the Chinese language has variants); | |
| printable | (deprecated in 1.35)When set toyes, the page is shown in a form that is suitable for printing. | |
| debug | When set totrue (e.g.1 ortrue), theResourceLoader serves non-minified JavaScript and CSS.SeeResourceLoader/Features#Debug mode. | www.mediawiki.org/w/index.php?title=Project:Sandbox&debug=true |
| safemode | When enabled (e.g. set to1 ortrue), user-provided CSS and JS will not be loaded.This disables personal scripts and styles (e.g. "User:" common.js and css), and site-wide scripts and styles (e.g. "MediaWiki:Common.js" and "MediaWiki:Common.css"), and all gadgets.[8]It is possible to mark site-wide styles ("MediaWiki:Common.css") as safe via$wgAllowSiteCSSOnRestrictedPages, which permits them in safemode. | www.mediawiki.org/w/index.php?title=MediaWiki&safemode=1 |
| useskinversion | Specify a skin version[9] | www.mediawiki.org/w/index.php?title=MediaWiki&useskinversion=2 |
| vectornightmode | When set to 1, the page is shown in dark mode on skins like Vector 2022 that support dark mode. | www.mediawiki.org/w/index.php?title=MediaWiki&useskin=vector-2022&vectornightmode=1 |
View is the default action. If no other action is added to the URL,action=view is used. This action shows a page, a revision, or the difference between two revisions of the same or two different pages. Below is a (partial) list.
oldid is not passed, the difference between this revision and the previous one on the same article is shown;oldid/direction and this one is shown; the value of this parameter can be a revision ID, the valuesprev ornext to identify a revision relative to the one given byoldid/direction, and the valuecur to identify the latest revision of the page;oldid anddiff need not be two revisions of the same article, allowing two revisions of two different pages to be comparedaction=view andaction=render and only if neitheroldid nordiff is given, as this is the only case where the target article is shown instead of the redirect;diffonly=yesThe following parameters apply only to categories.
from is not passed;The following parameter apply only to images.
dir=prev is added, it works the other way around, listing all editsafter the timestamp[10]atom andrss.Can be disabled with$wgFeed.go=first the first (earliest) page of history is shownPassingaction=raw returns the source code of a page or revision. For caching and security reasons, this should generally only be used via thescript path, that is,index.php?title=....While "short urls" like/wiki/ are only meant for action=view, they unofficially tend to work for other actions as well.This is expressly discouraged for action=raw as it leads to less effective caching and bypasses automatic purging after edits.
expand, templates within the page are expanded;text/x-wiki; this can only be one of the allowed types, which currently aretext/x-wiki,text/javascript,text/css, andapplication/x-zope-editnext,prev, orcur; instead of the revision specified by oldid, returns the one following it, the one preceding it, or the current (last) one;The edit and submit actions perform almost the same action. By default, they return an "edit page" form for the page. Different results can be obtained by passing other arguments; some results (such as saving the new version of a page) can only be obtained using POST. This action takes the standard arguments for specifying a page or a page revision.
The following options produce an effect on the edit form.(Note: 'section' also affects how the page is saved. Additionally, 'preload' and 'preloadparams' only work on wikitext contentmodel)
new is used to append a new section to the document;$1 style parameters in preload text.$1 replaced byfirst value and$2 replaced bysecond value.(introduced in 1.23)$1 style parameters is with<includeonly>{{SUBST:#ifeq:$1|$1|default value|$1}}</includeonly>yes orno, overrides user preference "Nuna samfurori lokacin da za a fara gyara" (T11936);file and using an external editor;undoafter revision up to theundo revision; technically, this is done by trying to merge the inverse of these edits with the sequence of all subsequent edits; the values of these parameters are IDs of old revisions of a page; if merge is not possible, a regular edit form for that revision is returnedThe following options tell the software what to do when submitting: saving, showing a preview, or showing the difference with the current version.
live argument is passed, only the rendering of the value of wpTextbox1 is shown, not the form and the other GUI element; this is similar to the result of saving and then viewing withaction=render; seeManual:Live preview for more info;wpLivePreview is identical to wpPreview; therefore, a regular preview is returned iflive is not passed;The following parameters are required when a user saves a page. The edit summary field may also be required if so configured (see below).
+\ rather than a random string (seeedit token suffix).For the page to be saved,wpStarttime,wpEdittime,wpTextbox1 andwpEditToken are required in a POST request, and neitherwpPreview norwpDiff are passed.If the page was deleted afterwpStarttime, the boolean optionwpRecreate is also required.
The edit summary or the "ignore blank" parameter may be mandatory if "warn on blank summaries" is configured.
new is used to append a new section to the document.wpEditSummary is the same as this field, the edit summary has not been modified.edit parameter and display the (now-)existing page instead.This parameter is used on red links.Most special pages have additional parameters, specific to the function they perform. As an example, the parameters forSpecial:Export are outlined inManual:Parameters to Special:Export
The following URL parameters provide initial values for some input fields; they can be edited before submitting the form.
wpReason=other| MediaWiki versions: | 1.10 – 1.27 |
Themaxlag parameter is used only if the software is running on a replicated database cluster.
The maxlag parameter makes it so a request is not served if there is high server traffic. maxlag parameter applies to all actions. maxlag parameter value is a number; the lower this value, the lower the traffic that causes the request not to be served. Zero is not allowed.
view, can be disabled using the$wgActions variable, which is now available for all actions.If searches are enabled and thesearch parameter is supplied (and non-blank) then all actions are ignored and the search is performed.
wpEditToken; this is what happens when the user confirms deletion.The delete reason is passed as the value of argumentwpReason; this string is recorded in the deletion log (thelog_comment_id field of thelogging table).Deletion is also performed when deleting a single version of an image; this requires the version ID to be passed in the parameteroldimage and a valid edit token inwpEditToken; in this case, the request can also be passed via GET.summary argument is passed, its value is used as the edit summary in place of the default onebot argument is passed, the edit will be marked as a bot one (the edit is markedrc_bot=1 in therecentchanges table)bot argument can also be used on any page a [rollback] link will appear on, to cascade&bot=1 to all rollback links generatedhidediff argument is passed, the success message is shown instead of a diff of the change (this can be forced via user preferences)mwProtect-level-edit andmwProtect-level-move if the request is a POST one and a valid edit token is passed aswpEditToken; parametermwProtect-reason gives the reason for protection or unprotection which will be recorded in the page log; ifmwProtect-cascade is also passed, cascading protection is applied (all transcluded pages are set to the same protection levels)array('edit','move') and can be changed inLocalSettings.php; the protection action then accept a parametermwProtect-level-$action for each action in that arrayaction=edit&redlink=1 (see below for an explanation of the redlink parameter)index.php?title=...