Template:Retrieved/sandbox
Retrieved 2025-01-03.
This is the template sandbox page for Template:Retrieved (diff). See also the companion subpage for test cases. |
For quick usage with today's date as access date, see Quickfill examples |
This template implements Citation Style 1 template-like behavior regarding online-retrieval information ("Retrieved ..."), mainly as applied in {{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 be used to 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. Please see § Exceptions for recommended usage exceptions. This template and its documentation make use of Citation Style 1 guidelines, with variations. Per common practice, "link" refers to a source's online location and "source" to its online content.
- Example:
A [[Brad Pitt]] statement.<ref>{{IMDb name|id=0000093|name=Brad Pitt}}. {{retrieved/sandbox |access-date=2025-01-03}}</ref>
===References===
{{reflist}}
- Generates:
Note: Examples use this page's current timestamp to format dates. Tomorrow's date may temporarily display as a result, depending on the local timezone, time of day and Wikipedia system settings. To apply the current timestamp manually,
the page.Usage
Listed by importance |
Syntax and presentation
For basic usage the template requires only the full date the source was retrieved (|access-date=<fulldate>
) which displays after the static text "Retrieved" (see § Access date).
Insert this template next to the prerequisite external link-providing template or when appropriate, after any other allowable external link. Ideally this template's output should immediately follow the external link, allowing for preceding white space as needed (note the editable default for "Retrieved" is to appear capitalized). Depending on parameter use, the template may display default presentation and formatting elements including static text, white space and additional punctuation.
All parameter names must be in lowercase; optional parameters will be ignored when they are misspelled or unrecognized. Dependent parameters are ignored if the prerequisite parameter is not used. Copy a blank version from the box above to use. Use the "|" (pipe) character between each parameter. Delete unused parameters.
The template uses Citation Style 1 presentation mode as the default; it may optionally use Citation Style 2 mode. The template provides limited error handling options.
See § Parameters for important details.
Exceptions
Do not use this template when either the link or the source is inaccessible or unfit for any reason. Use only with wikitext-supporting sources (free or restricted) 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). Please see Wikipedia:External links.
Quickfill examples: basic usage with today's date, autoinserted
The examples below autoinsert today's date[a] in full-date acceptable date formats via the available "quickfill" options. Copy and paste the suitable example code to use. 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-01-03.
Day Month Year [info]
{{retrieved/sandbox |access-date=dmy}}
- Retrieved 3 January 2025.
Month Day, Year [info]
{{retrieved/sandbox |access-date=mdy}}
- Retrieved January 3, 2025.
Day AbbreviatedMonth Year [info]
{{retrieved/sandbox |access-date=sdmy}}
- Retrieved 3 Jan 2025.
AbbreviatedMonth Day, Year [info]
{{retrieved/sandbox |access-date=smdy}}
- Retrieved Jan 3, 2025.
More examples: user-inserted access date, additional options
The examples in this section use the ISO date format (YYYY-MM-DD or Year-Month-Day) to enter access dates; by default they display access dates in the entered format except where stated as "autoformatted" and in the all-parameter example (via use of parameter df).
Basic usage [info]
{{retrieved/sandbox |access-date=2025-01-03}}
- Retrieved 2025-01-03.
Basic usage with autoformatted access date display (dmy) [info]
{{retrieved/sandbox |access-date=2025-01-03 |df=dmy}}
- Retrieved 3 January 2025.
Access information (registration) [info]
{{retrieved/sandbox |access-info=registration |access-date=2025-01-03}}
- . Retrieved 2025-01-03.
Source comment (version info) [info]
{{retrieved/sandbox |prepend=Revised |access-date=2025-01-03}}
- Revised. Retrieved 2025-01-03.
Source format (image) [info]
{{retrieved/sandbox |format=[[JPEG]] |access-date=2025-01-03}}
- (JPEG). Retrieved 2025-01-03.
Online provider information [info]
{{retrieved/sandbox |access-date=2025-01-03 |via=[[OnlinePublisherName]]}}
- Retrieved 2025-01-03 – via OnlinePublisherName.
Link comment [info]
{{retrieved/sandbox |access-date=2025-01-03 |note=brief link note}}
- Retrieved 2025-01-03 (brief link note).
No terminal punctuation [info]
{{retrieved/sandbox |access-date=2025-01-03 |postscript=none}}
- Retrieved 2025-01-03
Optional presentation mode (Citation Style 2) [info]
{{retrieved/sandbox |access-info=registration |prepend=revised |format=[[JPEG]] |access-date=2025-01-03 |via=[[OnlinePublisherName]] |note=brief link note |mode=cs2}}
- , revised (JPEG), retrieved 2025-01-03 – via OnlinePublisherName (brief link note)
All parameters
{{retrieved/sandbox |access-info=limited |nopun=y |prepend=(saved 3 January 2025) |format=[[DWG]] |access-date=2025-01-03 |df=dmy |via=[[Wayback Machine]] |note=archive [[Snapshot (computer storage)|snapshot]] link |mode=cs2 |postscript=; |err=y}}
- (saved 3 January 2025) (DWG), retrieved 3 January 2025 – via Wayback Machine (archive snapshot link);
Parameters
General notes
Parameter options, and dependent parameters, are described under their prerequisite parameters.
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, always include parameter access-info wherever applicable, as it is relevant to reader decisions regarding retrieval.
Incorrect usage of some parameters may suppress display of related template elements; see descriptions below, and § Error messages.
Required
The only required parameter is access-date or its alias accessdate.
Dependent
The parameter nopun requires use of parameter prepend.
Description
Access date
- access-date: This parameter (or its alias accessdate) is required – its omission or incorrect entry will produce an error message and will suppress all other template output. For basic usage include just this parameter; autoinsert today's date or manually enter a full date, only if in either date the external link (a) was successfully accessed and (b) targeted content supporting the related wikitext. Do not wikilink. When input correctly it will display as entered, after the static text "Retrieved". Except in the all-numeric Year-Month-Day (YYYY-MM-DD) format, days should be entered without zero-padding (i.e. 8 December 2024 instead of 08 December 2024); however, zero-padded days and months are required in the all-numeric format. Use any one of Wikipedia's full-date acceptable date formats, but if an acceptable format has been established in the article’s citations and/or references please select it (WP:DATEUNIFY). The ancillary optional parameter df may be added to autoformat or change the display of the access date; [examples]
- Autoinsert today's date: Quickly and correctly autoinsert today's date via one of the following "quickfill" options
|access-date=ymd
or|access-date=iso
– displays as the all-numeric Year-Month-Day (YYYY-MM-DD or ISO date).|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.
- See § Quickfill examples above.
- Manually insert a date: When manually entering the access date keep in mind
- Partial access dates (missing any of day, month or four-digit year) are strongly discouraged; they will either produce inaccurate access date display or suppress it with an error message.
- Access dates that do not conform to one of the allowed full-date formats (described in the quickfill options list) will produce an error. See following.
- Some formatting errors may be avoided by using the recommended parameter df.
- Future dates:
- Access dates that are 2 or more days in the future will display an error message instead of the access date. Tomorrow's date will display as access date without error.[b]
Access information
- access-info: If the online source has access requirements or restrictions use one of the options below to add an indicative inline icon (includes tooltip). Ideally it should display immediately after the external link and a non-breaking space. This parameter displays first, before any other template output. Invalid options will silently suppress the inline icon; if error-handling parameter err is used an error message will be displayed. See also § General notes; [example]
|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.
Source comment, link comment
- prepend: Use for additional citable information specific to the retrieved version of the source, only if necessary for clarity. This parameter may display first, or after parameter access-info; [example].
- nopun: prepend-dependent parameter. Set
|nopun=y
– any other input is ignored. Removes the default presentation mode punctuation autoinserted between access-info and prepend, leaving a single space as separator; [example].
- nopun: prepend-dependent parameter. Set
- note: Use to add a brief relevant comment specific to the accessed link. May be wikilinked. Displays in parentheses after the access date or parameter via; [example].
Additional information: source format, online provider
- format: Use only when the retrieved version has special format requirements or is in a different format from the original. Displays within parentheses. May be wikilinked. This parameter displays before the static text "Retrieved"; [example].
- via: Use to cite the online provider of the source’s specific accessed version if other than the original provider or publisher. May be wikilinked. Includes the leading static text "via" preceded by a spaced en dash and followed by a space. Displays after the access date; [example].
Display options: date format, presentation mode, terminal punctuation
- df: This parameter autoformats or changes the display of access-date irrespective of the way it is autoinserted or manually entered. Will correctly display the access date in a full-date acceptable date format according to the options below (partial dates are not supported). Invalid options are silently ignored and will prevent autoformatting; if error-handling parameter err is used a related error message will be displayed. Please follow any acceptable display format established in the article’s citations and/or references (WP:DATEUNIFY). Inclusion of this parameter is recommended when the access date is user-entered; [example]
- The
|df=
options are identical to parameter access-date quickfill options in both name and result (see there for descriptions): [ ymd/iso | dmy | mdy | sdmy | smdy ]
- Note: Parameter df formats the output (display) of access-date, not its input; ambiguous input, such as partial access dates may be misinterpreted, and an unintended access date may be displayed as a result.
- mode: Use to change the template presentation mode, which determines autoinserted element separators, terminal punctuation and certain capitalization; the default is Citation Style 1 mode. Invalid options silently suppress mode-related punctuation; if error-handling parameter err is used, the static text "Retrieved" will also be suppressed and an error message will be displayed. To override default terminal punctuation regardless of mode use postscript; [example]
|mode=cs2
– insert 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 static text "retrieved" is in lowercase.|mode=cs1
– the default presentation mode; enter to explicitly state, or to switch back to, the 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 static text "Retrieved" is capitalized.
- Note: Depending on the use of other parameters, mode's effect may display first, either as an error message or in the initial letter case of "Retrieved".
- postscript: Use to replace the presentation mode's default terminal punctuation; insert desired value, or set
|postscript=none
to remove terminal punctuation altogether; [example].
Error message handling
- err: Set
|err=y
to display all error messages related to optional parameters – any other input is ignored. Handling of individual or singular-parameter error messages is not supported. Depending on the erroneous parameter(s), using err may cause the relevant error message(s) to appear before all other template output. See also § Error messages; [examples].
With 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.[c] 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 to provide continuity and context to the output of {{retrieved}}.[d]
- Example:
A wikitext statement.<ref>{{harvnb|AuthorLast|2025|pp=[https://www.example.com 23–24]}}{{nbsp}}{{retrieved/sandbox |access-info=subscription |access-date=2025-01-03}}</ref>
===Notes===
{{reflist}}
===References===
{{refbegin}}
* {{cite journal |author-last=AuthorLast |date=January 2025 |title=ArticleTitle |journal=JournalName |issue=5 |pages=21–35 |url=https://example.com |url-access=limited |access-date=2025-01-03}}
{{refend}}
- Generates:
Notes
- ^ AuthorLast 2025, pp. 23–24 . Retrieved 2025-01-03.
References
- AuthorLast (January 2025). "ArticleTitle". JournalName (5): 21–35. Retrieved 2025-01-03.
Error messages
Error messages generated by access date-related errors are always displayed, and the edited page will be added to Category:Template Retrieved errors. If parameter access-date/accessdate is absent or mislabeled the error is fatal and will suppress all other template output.
Errors related to optional parameters are silent (messages not displayed) by default; they may be shown by using parameter err. Display of optional parameter error messages may suppress related template elements.
There is no error handling for individual parameters; error messages display for all optional parameters, or none.
Examples
Examples involving optional parameter errors use the all-parameters example from § More examples above.[d]
Access date information is missing or not entered correctly (parameter name)
{{retrieved/sandbox |access-info=subscription |date=2025-01-03 |via=OnlinePublisherName}}
Access date format is not valid (missing punctuation)
{{retrieved/sandbox |access-info=subscription |access-date=Jan 3 2025 |via=OnlinePublisherName}}
Access date is partial or incorrect
{{retrieved/sandbox |access-info=subscription |access-date=01-2025 |via=OnlinePublisherName}}
Access date is beyond tomorrow's date
{{retrieved/sandbox |access-info=subscription |access-date=2025-01-05 |via=OnlinePublisherName}}
Access information option not valid
{{retrieved/sandbox |access-info=free |nopun=y |prepend=(saved 3 January 2025) |format=[[DWG]] |access-date=2025-01-03 |df=dmy |via=[[Wayback Machine]] |note=archive [[Snapshot (computer storage)|snapshot]] link |mode=cs2 |postscript=;}}
- (saved 3 January 2025) (DWG), retrieved 3 January 2025 – via Wayback Machine (archive snapshot link);
Access information option not valid, and error messages on
{{retrieved/sandbox |access-info=free |nopun=y |prepend=(saved 3 January 2025) |format=[[DWG]] |access-date=2025-01-03 |df=dmy |via=[[Wayback Machine]] |note=archive [[Snapshot (computer storage)|snapshot]] link |mode=cs2 |postscript=; |err=y}}
- !
{{retrieved}}
: Parameter access-info – option not valid [info] ! (saved 3 January 2025) (DWG), retrieved 3 January 2025 – via Wayback Machine (archive snapshot link);
- !
Access date display option not valid, and error messages on
{{retrieved/sandbox |access-info=registration |nopun=y |prepend=(saved 3 January 2025) |format=[[DWG]] |access-date=2025-01-03 |df=US |via=[[Wayback Machine]] |note=archive [[Snapshot (computer storage)|snapshot]] link |mode=cs2 |postscript=; |err=y}}
- (saved 3 January 2025) (DWG), retrieved 2025-01-03 !
{{retrieved}}
: Parameter df – option not valid [info] ! – via Wayback Machine (archive snapshot link);
- (saved 3 January 2025) (DWG), retrieved 2025-01-03 !
Presentation mode option not valid, and error messages on
{{retrieved/sandbox |access-info=limited |nopun=y |prepend=(saved 3 January 2025) |format=[[DWG]] |access-date=2025-01-03 |df=dmy |via=[[Wayback Machine]] |note=archive [[Snapshot (computer storage)|snapshot]] link |mode=cs |postscript=; |err=y}}
- (saved 3 January 2025) (DWG) !
{{retrieved}}
: Parameter mode – option not valid [info] ! 3 January 2025 – via Wayback Machine (archive snapshot link);
- (saved 3 January 2025) (DWG) !
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; for additional use cases and details see the template's documentation. Parameters listed by order of 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. Do not wikilink. To autoinsert today's date enter a quickfill option: '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 (omit the single quote marks). Otherwise enter a full date, displays as entered; 'Access date format' may be used to autoformat the entered date | Date | required |
Access date format | df | Allowable access date display options; they are identical to 'Access date' quickfill options in name and function, but also apply to user-entered dates. Select one of the dropdown list options
| String | suggested |
Access information | access-info | Recommended when the source has access restrictions. Select one of the dropdown list options 'registration', 'subscription' or 'limited'; displays first, as a related lock icon
| Content | optional |
Source comment | prepend | 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 | 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 publisher; may be wikilinked, displays after the access date | String | optional |
Link comment | note | When required for clarification, add a brief note specific to the accessed link, may be wikilinked; displays after the access date (or 'Online provider' if used), in parentheses | String | optional |
Presentation mode | mode | Presentation mode affecting static text, parameter separators and terminal punctuation. Default is Citation Style 1 mode; from the dropdown list, select 'cs2' for Citation Style 2, or 'cs1' to switch back or to explicitly state the default
| String | optional |
Terminal punctuation | postscript | 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' without the quote marks | String | optional |
Source comment option | nopun | Use to suppress the autoinserted punctuation before the source comment - preset to 'y' (true); requires 'Source comment'. Deselect this parameter if not desired
| Boolean | optional |
Error message display | err | Displays all error messages related to non-required parameters; may suppress display of error-related template elements. Preset to 'y' (true) - deselect this parameter if it is not desired
| Boolean | optional |
Footnotes
- ^ Today's date is safe-substituted using relevant magic words.
- ^ The parser treats timestamps up to and including 38 hours beyond the current UTC datestamp (i.e. the whole day plus the maximum forward UTC offset) as "today", based on the current 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 link or source content and relevance may vary.
- ^ a b Categories are suppressed in examples that would otherwise categorize this page.