Template:Retrieved/sandbox
Retrieved 2025-04-11.
![]() | This is the template sandbox page for Template:Retrieved (diff). See also the companion subpage for test cases. |

To quickly apply this template with today's date as access date, see Quickfill examples Problems with template use? See Errors and notifications. |
![]() | This template uses Lua: |
This template implements Citation Style 1 template-like behavior regarding online-retrieval information ("Retrieved ..."), mainly as applied in template {{cite web}}. It may be used with citation and external link templates that do not provide retrieval information, such as
and others; it may also complement shortened footnote-producing templates such as {{harvnb}} and similar (see below). The template may accompany other allowable external links when such usage is appropriate; recommended exceptions are described in § Exceptions.
Syntax, application and documentation use Citation Style 1 guidelines, with variations. Presentation and notification options are available. Documentation examples may use the current date; if the date is not current the page.[a] Per common practice, "link" refers to a source's online location and "source" to its online content.
The template may assist verifiability, however it is not a tool for validating wikitext or discovering sources, and should not be used as an alternative to citations of online material.
- Example:
A [[Brad Pitt]] statement.<ref>{{IMDb name|id=0000093|name=Brad Pitt}}. {{retrieved/sandbox |access-date=2025-04-11}}</ref>
===References===
{{reflist}}
- Generates:
Usage
Listed by relative importance |
Syntax and interface elements[b]
Syntax: For basic use, only the full date the source was retrieved is required (|access-date=<fulldate>
); it displays after the static text "Retrieved ".
Insert this template next to the prerequisite external link-providing template or when appropriate, after any other allowable external link; its output should follow the link as closely as possible. See Wikipedia:Text-source integrity.
All parameters are named; some parameters have short-form aliases and/or predefined option sets. All parameter and option names or aliases must be entered in lowercase.
Copy a blank version from the box above to use. Insert the "|" (pipe) character between each parameter. Delete unused parameters. Unrecognized parameters are normally ignored.
Date elements: The template presumes Gregorian calendar information; it requires access dates in citation-compatible acceptable date formats. Some formats require zero-padded days and months, see § Access date.
Presentation: The template uses Citation Style 1 presentation mode as the default; it may optionally use Citation Style 2 mode. The editable default for the term "Retrieved" is to appear capitalized. Depending on the parameters used, other presentation and formatting elements including static text, white space and additional punctuation may be displayed.
Errors and notices: Usage errors and requirement or constraint violations may suppress related template elements and may add the edited page to a maintenance category ( ). Depending on the type of parameter(s) involved, notifications may display by default or by user preference.
Exceptions
Do not use this template when either the link or the source is inaccessible or unfit for any reason. The template applies only to wikitext-supporting sources (free or restricted)[c] that are retrievable through working, legitimate external links. See Wikipedia:Link rot.
Additionally, the template should not be used when retrieval information is inapplicable, superfluous, or not recommended, such as in External links or Further reading sections, or with templates such as {{official website}}.
In general do not use with stable or static external links e.g. links to online archives or repositories (however, it may be used when accessing online archive snapshots). See Wikipedia:External links.
Quickfill examples: Basic usage with today's date autoinserted
The examples below autoinsert today's full date[d] via the available "quickfill" options. For details, see § Access date. Consider adding parameter access-info when applicable.
All-numeric Year-Month-Day (ISO date) [info]
{{retrieved/sandbox |access-date=ymd}}
{{retrieved/sandbox |access-date=iso}}
- Retrieved 2025-04-11.
Day Month Year [info]
{{retrieved/sandbox |access-date=dmy}}
- Retrieved 11 April 2025.
Month Day, Year [info]
{{retrieved/sandbox |access-date=mdy}}
- Retrieved April 11, 2025.
Day AbbreviatedMonth Year [info]
{{retrieved/sandbox |access-date=sdmy}}
- Retrieved 11 Apr 2025.
AbbreviatedMonth Day, Year [info]
{{retrieved/sandbox |access-date=smdy}}
- Retrieved Apr 11, 2025.
More examples: User-inserted access date, additional options
The examples in this section use the all-numeric YMD or ISO date formats to insert access dates; by default they display access dates in the entered format (i.e. as YYYY-MM-DD), except where stated as "autoformatted" and in the "All parameters" example (via parameter date-format/df).[e]
Basic usage [info]
{{retrieved/sandbox |access-date=2025-04-11}}
- Retrieved 2025-04-11.
Basic usage with autoformatted access date display (dmy) [info]
{{retrieved/sandbox |access-date=2025-04-11 |date-format=dmy}}
- Retrieved 11 April 2025.
Access information (registration) [info]
{{retrieved/sandbox |access-date=2025-04-11 |access-info=registration}}
. Retrieved 2025-04-11.
Source information (version) [info]
{{retrieved/sandbox |access-date=2025-04-11 |source-info=Revised}}
- Revised. Retrieved 2025-04-11.
Source format (image) [info]
{{retrieved/sandbox |access-date=2025-04-11 |source-format=[[JPEG]]}}
- (JPEG). Retrieved 2025-04-11.
Online provider information [info]
{{retrieved/sandbox |access-date=2025-04-11 |via=[[OnlinePublisherName]]}}
- Retrieved 2025-04-11 – via OnlinePublisherName.
Link note [info]
{{retrieved/sandbox |access-date=2025-04-11 |link-note=brief link note}}
- Retrieved 2025-04-11 (brief link note).
No terminal punctuation [info]
{{retrieved/sandbox |access-date=2025-04-11 |postscript=none}}
- Retrieved 2025-04-11
Optional presentation mode (Citation Style 2) [info]
{{retrieved/sandbox |access-date=2025-04-11 |access-info=registration |source-info=revised |source-format=[[JPEG]] |via=[[OnlinePublisherName]] |link-note=brief link note |mode=cs2}}
, revised (JPEG), retrieved 2025-04-11 – via OnlinePublisherName (brief link note)
All parameters (using short-form aliases)
{{retrieved/sandbox |accessdate=2025-04-11 |access-info=registration |np=y |source-info=(revised) |format=[[JPEG]] |df=dmy |via=[[OnlinePublisherName]] |note=brief link note |mode=cs2 |ps=; |msg=y}}
(revised) (JPEG), retrieved 11 April 2025 – via OnlinePublisherName (brief link note);
Parameters
General notes
The parameter set consists of 11 native parameters; they may be required, dependent, conditional or preset (default). Dependent parameters and all parameter options are described under their prerequisites. Optional parameters are normally ignored when misspelled or when any prerequisite is absent. Unless specifically stated otherwise, predefined option sets disallow any other input for the related parameter.
Transcluded parameters should provide information specific to the retrieved version of the source or to the specific access link. Do not add an optional parameter if identical information is provided in the source's external link template, full citation, or other reference data (the access date is required regardless of duplication). However, include parameter access-info wherever applicable, as it is relevant to reader decisions regarding retrieval.
Incorrect parameter usage may suppress display of related template elements, see parameter descriptions and § Errors and notifications.
Requirements and constraints
- Parameter access-date or its alias accessdate is required.
- Parameter date-format (access date autoformat, alias df) is ignored when the access date is "quickfilled".
- Parameter np (a specific punctuation instance) is dependent on parameters access-info (access requirement information) and source-info (optional source information).
Parameter options may have additional specific requirements, constraints and conditions.
Description
Access date
- access-date, alias accessdate: Required. Its omission or incorrect entry will result in an error message and will suppress all other template output. For basic usage only include this parameter; autoinsert today's date or manually enter a full date. Either case requires a date when the external link (a) was successfully accessed and (b) targeted content supporting the related wikitext.[c] Do not wikilink. Displays after the static text "Retrieved " (the term followed by a non-breaking space).
- All-numeric YYYY-MM-DD date formats Year-Month-Day and ISO require zero-padded day and month numbers; all others must use non-padded numbering (i.e. 8 March 2025 instead of 08 March 2025). Use any one of Wikipedia's citation-compatible acceptable date formats, but select any acceptable format established in the edited page's citations or references (WP:DATEUNIFY). The ancillary optional parameter date-format/df may be added to autoformat the display of manually entered access dates.
- Autoinsert today's date: Enter one of the "quickfill" options[d] [examples]
|access-date=ymd
– displays as the all-numeric Year-Month-Day.|access-date=iso
– displays as above.|access-date=dmy
– displays as Day Month Year.|access-date=mdy
– displays as Month Day, Year.|access-date=sdmy
– displays as Day Month Year but with "short" (abbreviated) month name.|access-date=smdy
– displays as Month Day, Year but with "short" (abbreviated) month name.
- Manually insert a date: Enter a full date [examples]
- Partial access dates (missing any of day, month and year, or with truncated year) are strongly discouraged; they produce inaccurate access date output, or suppress it with a notification.
- Access dates that do not conform to one of the allowed full-date formats (also described in the quickfill options list) will generate a notification.
- Tomorrow's date will display as access date without error; access dates that are 2 or more days in the future will result in a notification instead.[f]
- Some format errors may be avoided by using the recommended parameter date-format/df.
Access information
- access-info: If the online source has access requirements or restrictions select the appropriate predefined option to insert an indicative inline icon/tooltip combination; see applicability detail in § General notes above. Normally this parameter's value displays first, ideally right after the external link (and a non-breaking space). Invalid options will silently suppress the inline icon/tooltip; if parameter msg is used a notification will be displayed when in error [example]
- Options:
|access-info=registration
– free registration is required; displays a gray lock icon.|access-info=limited
– free access is limited e.g. based on number of views, or is time-limited, or is only partially free; displays the same gray lock icon as registration, but with different tooltip text.|access-info=subscription
– paid subscription is required (WP:PAYWALL); displays a red lock icon. When set, the edited page will be added to Category:Pages containing links to subscription-only content.
- Dependents:
- np: See Dependents under parameter source-info.
Source information, link note
- source-info: Use for additional citable information specific to the retrieved version of the source, only if necessary for clarity. Displays after the output of parameter access-info if it exists, or first if it doesn't [example]
- Dependents:
- np: Conditional presentation parameter. Requires parameters access-info and source-info. Set
|np=y
(any other input is silently ignored). Removes the default presentation mode punctuation autoinserted between the adjacent outputs of the prerequisite parameters, leaving a single space as their separator [example]. If parameter msg is used notifications will be displayed when in error.
- np: Conditional presentation parameter. Requires parameters access-info and source-info. Set
- link-note, alias note: Use to add a brief relevant note specific to the accessed link. May be wikilinked. Uses only white space as leading separator. Displays in parentheses after the access date or after the output of parameter via [example].
Additional information: Source format, online provider
- source-format, alias format: Use only when the retrieved version has special format requirements or is in a different format than the original. May be wikilinked. When preceded by other parameters only white space is used as leading separator. Displays in parentheses before the static text "Retrieved " [example].
- via: Use to cite the online provider of the source’s accessed version if other than the original provider or publisher. May be wikilinked. Inserts the leading static text " – via " (the term preceded by a spaced en dash and followed by a space) before the provider name. Displays after the access date [example].
Display options: Date format, presentation mode, terminal & conditional punctuation
- date-format, alias df: Use this parameter to autoformat manually entered access dates. Select one of the predefined options to correctly display the access date in a full-date acceptable date format (partial dates are not supported). When an invalid option is entered or if the access date is quickfilled this parameter is silently ignored; both cases prevent autoformatting. If parameter msg is used, notifications will be displayed when in error.
- Use of date-format/df is recommended when applicable. Follow any acceptable date-display format established in the edited page’s citations and/or references (WP:DATEUNIFY) [example]
- Options:
|date-format=
(or|df=
) options are identical to parameter access-date/accessdate "quickfill" options in name and function, see there for descriptions. [ ymd/iso | dmy | mdy | sdmy | smdy ]
- Note: Parameter date-format/df applies to the output of parameter access-date/accessdate; ambiguous access date input such as a partial date may be misinterpreted by this parameter, producing unintended results.
- mode: Default parameter. Sets the template presentation mode which determines autoinserted element separators, terminal punctuation and certain capitalization; preset to Citation Style 1 mode. Invalid options silently suppress mode-related punctuation; if parameter msg is used any mode input plus the term "Retrieved" will be suppressed by a notification.
- To override default terminal punctuation regardless of mode use parameter postscript/ps.
- Options:
|mode=cs2
– set to switch to Citation Style 2 mode: the separator may include white space and/or a non-wrapping comma ( , ) or en dash ( – ), terminal punctuation is omitted, and the term "retrieved" is all-lowercase [example]|mode=cs1
– the default presentation mode; enter to explicitly state, or switch back to Citation Style 1 mode: the separator may include white space and/or a non-wrapping period ( . ) or en dash, terminal punctuation is a non-wrapping period, and the term "Retrieved" is capitalized.
- postscript, alias ps: Use to replace the presentation mode's default terminal punctuation; insert desired value, or set
|postscript=none
(or|ps=none
) to remove terminal punctuation altogether [example].
- np: Use to conditionally remove a specific punctuation instance. Requires parameters access-info and source-info, see above.
Notification handling
- msg: Optional, intended mainly for testing and debugging purposes. Set
|msg=y
to check for and display notifications about optional parameters, this parameter included; notifications for unrecognized parameters (including misspellings) will also be displayed. Notifications display first, before any other template output. Any and all such messaging will appear upon transclusion; handling of individual or per-parameter notifications is not supported. Incorrect input for msg will suppress all related notifications except the notification for itself; mislabeling the parameter will suppress any msg-induced notification.
Use case: Short citations
Short citations (WP:SFN) may include external links as in-source locations and be subject to the same retrieval information guidelines applying to full citations.[g] This template may be used to complement select short citation-producing templates, e.g. {{harvnb}}. See Template:Harvnb § Adding a URL for the page or location.
In the example below, {{harvnb}} output is followed by a non-breaking space (via {{nbsp}}) to provide continuity and context to the output of {{retrieved}}.[e]
- Example:
A wikitext statement.<ref>{{harvnb|AuthorLast|2025|pp=[https://www.example.com 23–24]}}{{nbsp}}{{retrieved/sandbox |access-info=subscription |access-date=2025-04-11}}</ref>
===Notes===
{{reflist}}
===References===
{{refbegin}}
* {{cite journal |author-last=AuthorLast |date=April 2025 |title=ArticleTitle |journal=JournalName |issue=5 |pages=21–35 |url=https://example.com |url-access=limited |access-date=2025-04-11}}
{{refend}}
- Generates:
Notes
- ^ AuthorLast 2025, pp. 23–24
. Retrieved 2025-04-11.
References
- AuthorLast (April 2025). "ArticleTitle". JournalName (5): 21–35. Retrieved 2025-04-11.
Errors and notifications
Error conditions and/or notifications may suppress display of related template elements.
Notifications generated by access date-related issues are always displayed, and the edited page is added to Category:Template Retrieved errors. If parameter access-date/accessdate is absent, mislabeled, or has no value the error is fatal and its notification message will suppress all other template output; any other template notifications display first, before other output.
Unrecognized parameter names and optional-parameter error conditions or maintenance issues are silent by default; the input error values and in some cases the error conditions are ignored. Parameter msg may be used to display any and all related notifications, generally for any unrecognized or misspelled parameter and specifically for optional parameters access-info, date-format/df, mode and np. The remaining optional parameters have no defined error state. When msg itself is in error its message or condition will suppress related notifications.
Notifications are delimited by exclamation marks ( ! ) and are grouped and numbered according to context; the numbering may not be strictly sequential. Error messages display mostly in red text, other notices in gray text.
No. | Type | Message | Link |
---|---|---|---|
F01 | [fatal error] | ! Parameter access-date/accessdate is missing, mislabeled, or has no value ! | [info] |
E11 | [usage error] | ! Access date is partial or incorrect ! | [info] |
E12 | [usage error] | ! Access date format is invalid ! | [info] |
E13 | [constraint] | ! Access date is invalid future value ! | [info] |
E21 | [usage error] | ! Access information option is invalid ! | [info] |
E31 | [constraint] | ! Date format is superfluous (autoinserted access date) ! | [info] |
E32 | [usage error] | ! Date format option is invalid ! | [info] |
E41 | [usage error] | ! Presentation mode option is invalid ! | [info] |
E42 | [usage error] | ! Parameter np value is invalid ! | [info] |
E43 | [constraint] | ! Parameter np requires parameter source-info ! | [info] |
E44 | [constraint] | ! Parameter np requires parameter access-info ! | [info] |
No. | Type | Message | Link |
---|---|---|---|
N01 | [usage] | ! Unrecognized parameter name <parameter name> ! | [info] |
See also
- Template:Access-date – a wrapper of this template, quickly provides only the access date and accepts the quickfill options
- Template:Dead link – a maintenance template for dead or inaccessible links
TemplateData
TemplateData for Retrieved
This template adds online-retrieval information ("Retrieved ...") to external link templates that do not provide such facility; it follows Wikipedia citation-template guidelines, with variations. All date input must be in one of Wikipedia's citation-related acceptable full-date formats. When entered manually, predefined options must be in lowercase, without quote-marks. For details and examples see the template's documentation. Parameter list order reflects relative importance
Parameter | Description | Type | Status | |
---|---|---|---|---|
Access date | access-date accessdate | The full date the external link (a) was successfully accessed, and (b) targeted relevant wikitext-supporting content. To autoinsert today's date select a "quickfill" option from the dropdown list or type it in (lowercase, no quote-marks): 'ymd' or 'iso' for all-numeric Year-Month-Day; 'dmy' for Day Month Year; 'mdy' for Month Day, Year; 'sdmy' for Day Month Year with abbreviated month name; 'smdy' for Month Day, Year with abbreviated month name. Otherwise enter a full date, displays as entered; all-numeric date formats require zero-padded day and month numbers. 'Access date format' may be used to autoformat manually entered dates
| String | required |
Access information | access-info | Recommended when the source has access restrictions. Select the relevant dropdown list option or type it in (lowercase); it displays first, as a related lock icon/tooltip combination
| Content | optional |
Access date format | date-format df | Access date autoformat options for manually entered dates; identical to 'Access date' quickfill options in name and function. Deselect this parameter when using autoinserted access dates; recommended otherwise. Select a dropdown list option or type it in (lowercase)
| String | suggested |
Source information | source-info | Use only when additional citable information specific to the retrieved version is needed for clarity; displays after 'Access information' if it exists, or first if it doesn't | String | optional |
Source format | source-format format | Use only if the retrieved version is in different format than the original or has specific format requirements; may be wikilinked, displays in parentheses before "Retrieved" | String | optional |
Online provider | via | Name of the accessed version's online provider if other than the original provider or publisher; may be wikilinked, displays after the access date | String | optional |
Link note | link-note note | When required for clarification add a brief note specific to the accessed link, may be wikilinked; displays in parentheses after the access date (or 'Online provider' if it exists) | String | optional |
Presentation mode | mode | Presentation mode, applies static text, parameter separators and terminal punctuation. Preset to Citation Style 1 mode; enter (in lowercase, no quote-marks) or select from the dropdown list option 'cs2' for Citation Style 2, 'cs1' to switch back or explicitly state the default
| String | optional |
Terminal punctuation | postscript ps | Insert desired value to replace the presentation mode's default terminal punctuation, which is either a period (mode 'cs1') or nothing (mode 'cs2'); to remove terminal punctuation altogether enter 'none' (lowercase, no quote-marks) | String | optional |
Notification display | msg | Set to 'y' (lowercase, no quote-marks) to display all notifications related to optional parameters; may suppress display of related template elements; use to test template output before committing
| Boolean | optional |
Conditional punctuation | np | When applicable, set to 'y' (lowercase, no quote-marks) to suppress the autoinserted punctuation (but not the space) between 'Access information' and 'Source information'; both are prerequisites
| Boolean | optional |
Footnotes
- ^ Examples use this page's current timestamp to format dates (for en: at UTC+00:00 as of 2024-10-15[update]). Tomorrow's date may temporarily display as a result, depending on the local timezone, time of day and Wikipedia system settings.
- ^ Rudimentary description of the template's logic may be found in Template talk:Retrieved § Logic (sandbox).
- ^ a b Retrieval information must apply to the specific wikitext (WP:TSI). The retrieved source's overall relevance to the edited page's subject, or its reliability, is beyond the template's scope.
- ^ a b Today's date is substituted using the relevant parser function.
- ^ a b Categories are suppressed in examples that would otherwise categorize this page.
- ^ The parser treats timestamps up to and including 38 hours beyond the current UTC datestamp, i.e. the 24-hour-day plus the maximum forward UTC offset, as "today" based on the current (en:) system timezone setting.
- ^ The full citation's retrieval information may not apply to short citations. Specific in-source locations may have different access and/or retrieval requirements. Depending on either the full or short citation's access date, the state of the respective external links may vary. In addition the short citation's text-source integrity and accessibility may depend on specific information.