Help:Magic words

Magic words (including parser functions, variables and behavior switches) are features of wiki markup that give instructions to Wikipedia's underlying MediaWiki software. For example, magic words can suppress or position the table of contents, disable indexing by external search engines, and produce output dynamically based on the current page or on user-defined conditional logic. Some of these features are especially useful for templates.

This page is a quick reference for magic words. For more information, refer to the main MediaWiki documentation:
 * mw:Help:Magic words: All standard magic words, including the "standard" parser functions.
 * mw:Help:Extension:ParserFunctions: Additional parser functions, including conditional expressions.

General information
In general, there are three types of magic words
 * 1) Behavior switches: often appear in double underscores, all uppercase, e.g.,  . They will change the behavior of a page, rather than return a value.
 * 2) Parser functions: all in lowercase. A parser function will be followed by colon and pipe-separated parameters, e.g., , wrapped in double braces. They will take a value and return a value.
 * 3) Variables: these are all uppercase, e.g., . A variable will be wrapped in double braces and will return a value in its place.

The software generally interprets magic words in the following way.
 * Magic words are case sensitive.
 * White space is generously allowed for readability. It will be stripped from the start and end of their keywords and parameters (as is also done inside templates).
 * They can be transcluded, even variables "about the current page". This is ensured by the parsing order.
 * Instead of magically transforming into HTML instructions, tags remove this magic so a magic word can itself be displayed (documented), e.g.   or.

Magic words compared to templates:
 * As with templates, magic words can be transcluded and substituted.
 * The names of magic words are purposely chosen to be unlike the names of templates, and vice versa. Many parser function names will begin with a  (pound or hash), but template names  will not start with a , and probably not end in a   (colon), or be all-uppercase.
 * The first parameter's syntax differs. In, the name is   and it is followed by an unspaced   and a required input parameter,  . With a template,   is optional and it is preceded by a   (pipe) instead of a  , e.g..

Variables
Note: The magic words above can also take a parameter, in order to parse values on a page other than the current page. A colon is used to pass the parameter, rather than a pipe ( | ) that is used in templates, like. For example, returns Wikipedia talk:MOS on any page.

Note: In the "Category" and "Category talk" namespaces, to wikilink (some) page name variables may require prefixing a colon to avoid unwanted categorization.

Other variables by type

 * $a$ This shows the last user to edit the page. There is no way to show the user viewing the page due to technical restrictions.

Metadata
To output numbers without comma separators (for example, as "123456789" rather than "123,456,789"), append the parameter |R.

Conditional
If, in these conditional functions, empty unnamed parameters are to be parsed as empty rather than as text (i.e. as empty rather than as the text "", "", etc.), they will require trailing pipes (i.e. {{{1|}}}, {{{2|}}} , etc., rather than ,  , etc.).
 * For the use of these functions in tables, see Help:Conditional tables.