Help:Magic words

Magic words are strings of text that MediaWiki associates with a return value or function, such as time, site details, or page names. This page is about usage of standard magic words; for a technical reference, see Manual:Magic words.

Parsing
The syntax of most magic words is similar to templates, but capitalized to help avoid conflicts. If a template has the same name and case as a magic word, the magic word will be used. Usage of the template can be forced by adding the "msg:" modifier (for example, " "). In some cases, adding parameters will force the parser to treat a magic word as a template; for example,  tries to transclude "Template:CURRENTDAYNAME".

Page-dependent magic words will return data about the currently-viewed page, regardless of whether it is in the page code or a transcluded template.

Date & time
The following variables return the current date and time according to the user's timezone preferences, defaulting to the UTC timezone.

Due to MediaWiki and browser caching, these variables frequently show when the page was cached rather than the current time.

The following variables do the same as the above, but using the site's local timezone instead of user preferences and UTC:
 * 2024
 * August
 * 27
 * Tuesday
 * 27
 * Tuesday
 * Tuesday
 * Tuesday

Latest revision to a page
The following variables return data about the latest edit to the current page, even if viewing an older version of the page.

Page names
The following are URL-encoded equivalents:

Namespaces
The following are URL-encoded equivalents:

returns the localized namespace name for that number of constant. The default values are: