Manual:Parameters to index.php

This page is a partial list of the parameters to index.php, the main script of the MediaWiki software. 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 for anonymous users.

Note: The information on this page is not complete.

Actions
The following is a list of  parameters.

Some of these actions can be enabled/disabled by using a dedicated configuration setting in. Where available, these local settings are listed.

{|class="wikitable sortable" width=85% align=center !width=5%|Name!!width=50% class="unsortable"|Function!!width=25% class="unsortable"|Example
 * -valign=top
 * View
 * View is the default action; view is the one action that is used when no action is explicitly given
 * http://en.wikipedia.org/w/index.php?title=Elephant&action= view 
 * -valign=top
 * Print
 * Same as "View"
 * http://en.wikipedia.org/w/index.php?title=Elephant&action= print 
 * -valign=top
 * Watch
 * Adds the page to the user's watchlist
 * http://en.wikipedia.org/w/index.php?title=Elephant&action= watch 
 * -valign=top
 * Unwatch
 * Removes the page from the user's watchlist
 * http://en.wikipedia.org/w/index.php?title=Elephant&action= unwatch 
 * -valign=top
 * delete
 * Deletes a page

By default, delete returns a form for the user to confirm deletion and specify a reason.
 * http://en.wikipedia.org/w/index.php?title=Elephant&action= delete 
 * -valign=top
 * Revert
 * Reverts to a previous version of an image. The following two other parameters are required:
 * , the id of the version to revert to;
 * , a valid edit token;


 * -valign=top
 * 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. The following two other parameters are required:
 * is the username whose edits are to be reverted
 * is a rollback token; used to prevent users from being tricked into performing an unwanted rollback by following a link or clicking a button in an external website.


 * http://en.wikipedia.org/w/index.php?title=User_talk:David_Gerard&action= rollback & from =Highfructosecornsyrup& token =d7aaa6c4158be5500ee306003fd00f50\
 * -valign=top
 * Protect
 * Shows or changes the protection levels of a page:
 * By default, this script returns a form showing the current protection levels of the page, allowing the user to change the protection levels of the page.


 * http://en.wikipedia.org/w/index.php?title=Elephant&action= protect 
 * -valign=top
 * Unprotect
 * Same page as protect (unprotect and protect are the same page, and do the same thing).
 * http://en.wikipedia.org/w/index.php?title=Elephant&action= unprotect 
 * -valign=top
 * Markpatrolled
 * Marks an edit as patrolled; see meta:Help:Patrolled edit.

is the id of an edit in the recentchanges table
 * -valign=top
 * Render
 * Shows an HTML rendering of the page; similar to the  action, but only the article text is shown, not the additional toolboxes, searchboxes,  etc.
 * http://en.wikipedia.org/w/index.php?title=Elephant&action= render 
 * -valign=top
 * deletetrackback
 * Related to TrackBack.

This action is disabled by default in
 * -valign=top
 * Purge
 * Clears the page's cache, forcing the page to be redisplayed from its source;
 * This action is automatically performed for logged-in users
 * For non logged-in users, the action is performed only if requested via a POST request; otherwise, a form to confirm purging is shown (pressing the OK button posts the purge request, which is then executed)


 * http://en.wikipedia.org/w/index.php?title=Elephant&action= purge 
 * -valign=top
 * Submit
 * Performs various actions related to changing the page (see below for more details):
 * By default, shows the page in edit form, with edit box.
 * Various other arguments can be used to:
 * Change a page,
 * preview a new version of the page, or
 * show the difference with a new version (see edit and submit section below for details);


 * http://en.wikipedia.org/w/index.php?title=Elephant&action= submit 
 * -valign=top
 * Edit
 * Shows the page in edit form, "edit" does almost the same thing as submit
 * http://en.wikipedia.org/w/index.php?title=Elephant&action= edit 
 * -valign=top
 * Editredlink
 * Same as edit.
 * http://en.wikipedia.org/w/index.php?title=Elephant&action= editredlink 
 * -valign=top
 * History
 * Shows the history of the page. (See history, below)
 * http://en.wikipedia.org/w/index.php?title=Elephant&action= history 
 * -valign=top
 * 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.
 * http://en.wikipedia.org/w/index.php?title=Elephant&action= raw 
 * -valign=top
 * Ajax
 * If enabled, calls a php function registered via $wgAjaxExportList; see Manual:Ajax.
 * -valign=top
 * Creativecommons
 * DISABLED Disabled by default via $wgEnableCreativeCommonsRdf
 * -valign=top
 * Credits
 * DISABLED not documented.
 * -valign=top
 * Dublincore
 * DISABLED Disabled by default via $wgEnableDublinCoreRdf
 * -valign=top
 * Info
 * DISABLED Shows information about the page, such as the number of users having it in their watchlist, the number of edits, the number of authors.
 * Info
 * DISABLED Shows information about the page, such as the number of users having it in their watchlist, the number of edits, the number of authors.

Info is disabled for performance reasons on Wikimedia wikis, and disabled by default in MediaWiki installations.
 * -valign=top
 * z
 * z

User preference overriding
The following parameters override some of the user's preferences. Other parameters explained in other sections are "diffonly", "internaledit", and "externaledit". The below four parameters affect all actions but "render" and "raw".
 * -valign=top
 * Useskin
 * Specify a skin
 * -valign=top
 * Uselang
 * Specify a language for the UI elements (such as the "my talk" link, etc.); this is especially useful for creating an account, because at that stage no preference settings apply.

Uselang is also used as general parameter, not related to language, to select from a range of versions of a MediaWiki page, and for a combination of language code and some other parameter, see commons:Commons:Upload and
 * http://meta.wikimedia.org/w/index.php?title=Special:Userlogin&type=signup& uselang =de
 * -valign=top
 * Variant
 * Specify a language variant for the UI elements (this is used for example in the Chinese Wikipedia, as the Chinese language has variants);
 * -valign=top
 * Printable
 * When typed with value, the page is shown in a form that is suitable for printing
 * z
 * z

Page revision or version
The page (or a version of it) can be specified by typing one or more of the following parameters:
 * http:// en.wikipedia.org/w/index.php? title =Ferengi& curid =177126& diff =304901009& oldid =304764764''
 * Title
 * The title of the page
 * Curid
 * The id of the page; overrides the value of title
 * Curid
 * The id of the 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 two following parameters, allowing the omission of the title and the id of the page.
 * Oldid
 * The id of a revision
 * Direction
 * Instead of the revision given by oldid, use:
 * : the one preceding it
 * : the one following it
 * : the one preceding it
 * : the one following it


 * }

View and render
View is the default action. If no other action is added to the URL,  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.


 * diff : the value of this parameter identifies a revision; the difference between another revision and this one is returned:
 * if  is not passed, the difference between this revision and the previous one on the same article is shown;
 * otherwise, the difference between the revision given by  and this one is shown; the value of this parameter can be a revision id, the values   or   to identify a revision relative to the one given by , and the value   to identify the latest revision of the page;
 * Note that  and   needs not to be two revisions of the same article, allowing two revisions of two different pages to be compared


 * redirect : if the value of this parameter is 'no' and the page is a redirect, the page itself is shown and not the target of the redirect; this parameter has effect only on  and   and only if neither   nor   is given, as this is the only case where the target article is shown instead of the redirect;
 * rdfrom : when the page is the result of following a redirect from an external wiki, this parameter tells which wiki that was, so that the "Redirected from ..." line can be shown
 * diffonly : override the user's preference on whether to render the page when a diff is requested
 * search : if non-blank (and if searches are enabled), override all other parameters and perform a search

The following parameters apply only to categories.


 * from : if the page is a category, only list entries whose sortkey are equal or follows the value of this parameter;
 * Example:http://en.wikipedia.org/w/index.php?title=Special:Log&type=upload & from =20070814233520&until=20070814233525
 * Links to a log of all the images uploaded on August 14, 2007 from 23:35:20 until 23:36:25


 * until : if the page is a category, only list entries whose sortkey precedes the value of this parameter; only used if  is not passed;

The following parameter apply only to images.


 * page : a page number in a multi-page media; it currently only applies to DjVu files; first page is numbered 1;

History

 * limit : number of page edits to list, maximum is 5000 edits.
 * Example: http://en.wikipedia.org/w/index.php?title=Special:Contributions &limit =13&contribs=user&target=Atlgirl052005, lists 13 edits per page.


 * dir : the relative order of edit history pages.
 * with  the earliest page of the history is shown as the first page;
 * any other value means that the latest page of history is shown first;
 * within each page, entries are sorted in decreasing timestamp in both cases.


 * offset : uses a timestamp to specify which part of the history is displayed;
 * Returns the edits which occurred before the timestamp;
 * Example: http://en.wikipedia.org/w/index.php?title=Special:Contributions &offset=20090815195334 &contribs=user&target=Atlgirl052005
 * Shows the edits which occurred immediately before the timestamp 20090815195334 (20090815195334 is not shown).
 * Parameter format is yyyymmddhhmmss. So 20090815195334 was created on August 15, 2009 [20090815] at 19:53 (UTC) and 34 seconds [195334].
 * See Wikipedia:Complete diff and link guide.
 * if  is added, it works in the other way around, listing all edits after the timestamp
 * Example: http://en.wikipedia.org/w/index.php?title=Special:Contributions&dir=prev&offset=20090815195334 &dir=prev &contribs=user&target=Atlgirl052005
 * Shows the edits which occurred immediately after the timestamp 20090815195334 (20090815195334 is not shown).


 * feed : a feed for the changes in the history is returned; allowed values are  and
 * go : (deprecated)  the first (earliest) page of history is shown

Raw
Passing  returns the source code of a page or revision. For security reasons, in some versions of MediaWiki this is only allowed when using the "primary script access point", that is, when using the "ugly" URL form with index.php?title=...


 * templates : if passed with value, templates within the page are expanded;
 * ctype : the content-type value to be used in the HTTP header when returning the raw content, instead of the default ; this can only be one of the allowed types, which currently are ,  ,  , and
 * maxage : the value of max-age in the Cache-Control HTTP header field to be used when returning the raw page (client cache)
 * smaxage : the value of s-maxage in the Cache-Control HTTP header field to be used when returning the raw page (cache-server cache)
 * usemsgcache : only applies to pages in the MediaWiki namespace; if this argument is present, the content of the message is returned from the message cache and not from the database
 * oldid : the id of a specific revision to return
 * direction : either,  , or  ; instead of the revision specified by oldid, returns the one following it, the one preceding it, or the current (last) one;
 * gen : this argument can take value  or  ; the return value is a generated user CSS stylesheet or JavaScript
 * section : Limits output to a particular section or subsections of the document. Sections are specified with non-negative integers : section 0 being the section before any named sections, section one being the first named section or subsection and so on. The numbering scheme treats sections and subsections as identical. A list of the sections and subsections can be obtained via API with api.php?action=parse&text=&#123;&#123;:My_page&#125;&#125;&#95;&#95;TOC&#95;&#95;&prop=sections.

Edit and submit
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.

Options affecting the edit form
The following three options produce an effect on the edit form (the first one also affects how the page is saved.)


 * section : specifies the index of a section within a document to preload and edit; sections are numbered sequentially from 0 on; section 0 is the part of the article before the first section header; value  is used to append a new section to the document;
 * preload : specifies a page, of which the wikitext is used as the initial value of the textarea in the edit form if the page or section to be edited does not exist; if it exists the preload command is ignored (bug 5210 since 2006-03-09: this will preload almost the full wikitext of the source page, including the noinclude parts and tags, but not the includeonly tags.); also see Manual:Creating pages with preloaded text;
 * Example: http://en.wikipedia.org/wiki/Talk:Main_Page?action=edit&section=new&preload=Template:Foo


 * editintro : title of an existing article or template to be rendered above the edit form;
 * preloadtitle : in the case of section=new, provides initial content of the "Subject/headline" box; it can be edited before saving;
 * Example: http://en.wikipedia.org/w/index.php?title=User_talk:5dsddddd&action=edit&section=new&preloadtitle=The+%5B%5BWP%3AARS%7CArticle+Rescue+Squadron%5D%5D
 * Example with both preloadtitle and preload: http://en.wikipedia.org/wiki/User_Talk:Ikip?action=edit&section=new&preload=Template:Article_Rescue_Squadron_ invite&preloadtitle=Invitation


 * preview : overrides user preference "Show preview on first edit" (bug 9936);
 * internaledit/externaledit : overrides user preference on external editors;
 * mode : this parameter affects the result page if passed with value file and using an external editor;
 * undo : attempts to undo an edit or a sequence of edits; technically, this is done by trying to merge the inverse of these edits with the sequence of all subsequent edits; the value of this parameter is an id of an old revision of a page; if merge is not possible, a regular edit form for that revision is returned
 * by default, undone is attempted on the edit preceeding the given revision id;
 * if undoafter is also given, the changes between the revisions  and   are attempted to be undone;

What to do
The following options tells the software what to do when submitting: saving, showing a preview, or showing the difference with the current version.


 * wpSave : this argument is generated when saving the content of an edit form returned by the server, but is not actually used nor required when submitting (see below for required arguments to save);
 * wpPreview : set in a POST request to request a preview of the page or section as if the value of wpTextbox1 were saved;
 * by default, returns an edit form with a preview of the value of wpTextbox1;
 * if the additional  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 with  ; see  Manual:Live preview for more info;
 * the argument  is identical to wpPreview; therefore, a regular preview is returned if   is not passed;
 * wpDiff : set in a POST request to request a table showing the changes between the current version of the page or section and the version as if value of wpTextbox1 were saved;

Parameters that are needed to save
The following parameters are required when a user saves a page. The edit summary field may also be required if so configured (see below).


 * wpTextbox1 : the new page/section content;
 * wpStarttime : the timestamp of when the user started editing the page; used to check whether the page has been deleted between this moment and the submission time (in this case, the user is asked to confirm saving);
 * wpRecreate : in case the page was deleted after wpStarttime, this field confirms that the page is to be saved;
 * wpEdittime : for new pages, it is equal to wpStarttime; otherwise, it is the timestamp of the last revision of the page; used to check edit conflicts;
 * wpEditToken : an edit token; this is used to avoid users from being tricked into saving a page by following a link or pressing a button in an external site. For non-logged-in users, wpEditToken is required since revision 18112; it currently contains only the characters, rather than a random string (see edit token suffix).

For the page to be saved,,  ,   and   are required in a POST request, and neither   nor   are passed. If the page was deleted after, the boolean option   is also required.

Optional additional data
The edit summary or the "ignore blank" parameter may be mandatory if "warn on blank summaries" is configured.


 * wpSummary : the edit summary;
 * wpMinoredit : if set in a save request, the edit is marked as minor; for preview and diff, it is the initial value of "this is a minor edit" checkbox in the edit form;
 * wpWatchthis : if passed on a save request, the page is added to the user's watchlist; if it is not passed in a save request, the page is removed from the user's watchlist; for preview or diff, this is the initial value of the "watch this page" checkbox of the edit form;
 * wpSection : specify the index of a section within a document to submit to; sections are numbered sequentially from 0 on; section 0 is the part of the article before the first section header; value  is used to append a new section to the document;
 * wpAutoSummary : contains the MD5-hashing of the edit summary field as initially presented to the user in the edit form; this field is used to check if the user has modified that field before submitting: if the MD5 hashing of the value of  is the same as this field, the edit summary has not been modified;
 * wpIgnoreBlankSummary : save page even if user has not modified the edit summary, while they were supposed to;
 * wpTextbox2 : in case of an edit conflict, it contains the value of wpTextbox1 of the save request that generated the conflict;
 * safemode : some browsers are known to have problems with editing text containing Unicode characters; when a request for an edit form come from one such browser, the non-ascii characters in the initial content of the textarea are converted into the form  and the value   is hidden in the form; when submitting, the   field indicate that the the inverse translation is to be performed; a browser is considered non-Unicode-compliant if the User-Agent HTTP header matches a regular expressions in the variable $wgBrowserBlackList; Note: this has nothing to do with PHP's safe_mode setting.
 * wpScrolltop : used to preserve the scrollbar position in the edit textbox when loading a preview.
 * redlink : if the user does not have permission to edit the page, redirect to the empty article page (e.g., "Wikipedia does not have an article with this exact name") instead of showing the permission error notice; this parameter is used on red links.

Special pages
Most special pages have additional parameters, specific to the function they perform. As an example, the parameters for Special:Export are outlined in Manual:Parameters to Special:Export

The following URL parameters provide initial values for some input fields; they can be edited before submitting the form.
 * wpReason: on Special:MovePage and action=delete: text field with reason.
 * wpBlockReason: on Special:BlockIP: text field with reason.
 * wpBlockReasonList: on Special:BlockIP: initially selected item in the drop-down box, value should match a row in the MediaWiki:Ipbreason-dropdown.
 * mwProtect-reason: on action=delete: text field with reason.

FlaggedRevisions extension

 * stable: if set to 1, last stable version is shown.
 * stableid: seems to be the same as oldid (maybe image/template inclusion is handled differently?). Setting  will give the best version (pristine > quality > sighted > last).
 * filetimestamp: link to the image version used at a certain date? doesn't seem to have any effect.

Userscript parameters
Userspace JavaScript scripts may take additional parameters passed via GET or POST. If the user's or global JavaScript script include Lupin's Autoedit Script, the following parameters are used for automated editing: autoedit, autosummary, autoclick, and autominor. Some more details are given in Extension:Autoedit.

Maxlag parameter
maxlag parameter is used only if the software is running on a replicated database cluster.

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.