Template:Retrieved/sandbox
Retrieved 2026-10-04.
| 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 applies online-retrieval information ("Retrieved ...") as implemented by Citation Style 1 templates, mainly 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 . The template may accompany other allowable external links when such usage is appropriate; recommended exceptions are described in § Applicability and placement. Although its use may assist verifiability, the template is not a tool for validating wikitext or discovering sources, and should not be considered an alternative to citations of online material.
Syntax, application and documentation use Citation Style 1 guidelines, with variations. Presentation and notification options are available. Documentation examples use the current date unless specified otherwise; if the date is not current the page.[a]
"Link" refers to the retrieved material'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=2026-10-04}}</ref>
=== References ===
{{reflist}}- Generates:
Usage
|
Listed by relative importance |
Syntax and interface elements[b]
Syntax: For basic use, only the full date the material was retrieved on is required – via parameter access-date or its alias accessdate (|access-date[accessdate]=full date); it displays after the static text "Retrieved ".
All parameters are named; some parameters have short-form aliases and/or predefined option sets. All parameter and option names/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 or undefined parameters are normally ignored; defined parameters do not display without a value.
Date elements: The template presumes Gregorian calendar information; access dates must be in citation-compatible acceptable date formats. With one exception, dates require non-padded day and month numbers .
If the edited page includes a {{use xxx dates}}-class template the access date format set therein is passed to this template as the (editable) default.[c]
Presentation: Citation Style 1 presentation mode is the default; optionally Citation Style 2 mode may be used. Per Citation Style 1 usage the static term "Retrieved" appears capitalized in default mode. Depending on the utilized parameters, other presentation and formatting elements including static text, white space and additional punctuation may display.
Errors and notices: Usage errors and requirement or constraint violations may suppress related template elements and in rare cases may produce temporarily-hidden errors; additionally, the edited page may be listed in a maintenance category . Depending on the type of parameter(s) and type of issue(s) involved, relevant notifications may display by default or by user preference.
Applicability and placement
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)[d] that are retrievable through working, legitimate external links (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 (Wikipedia:External links); however, it may be used when accessing non-current online archive snapshots.
Placement: Insert this template next to the prerequisite external-link template or when appropriate, after any other allowable external link; to conform with Wikipedia:Text-source integrity, its output should follow the link as closely as possible.
Quickfill examples: Basic usage with today's date autoinserted
The examples below autoinsert today's date[e] via the available "quickfill" options . Consider adding parameter access-info/ai when applicable.
All-numeric Year-Month-Day [info]
{{retrieved/sandbox |access-date=ymd}}
- Retrieved 2026-10-04.
Day Month Year [info]
{{retrieved/sandbox |access-date=dmy}}
- Retrieved 4 October 2026.
Month Day, Year [info]
{{retrieved/sandbox |access-date=mdy}}
- Retrieved October 4, 2026.
Day AbbreviatedMonth Year [info]
{{retrieved/sandbox |access-date=sdmy}}
- Retrieved 4 Oct 2026.
AbbreviatedMonth Day, Year [info]
{{retrieved/sandbox |access-date=smdy}}
- Retrieved Oct 4, 2026.
More examples: User-inserted access date, additional options
The examples in this section use the all-numeric YMD format to insert access dates; by default they display access dates in the same format (i.e. as YYYY-MM-DD), except where stated as "autoformatted" and in the "All parameters" example (via parameter date-format/df).[f]
Basic usage [info]
{{retrieved/sandbox |access-date=2026-10-04}}
- Retrieved 2026-10-04.
Basic usage with autoformatted access date display (dmy) [info]
{{retrieved/sandbox |access-date=2026-10-04 |date-format=dmy}}
- Retrieved 4 October 2026.
Access information (registration) [info]
{{retrieved/sandbox |access-date=2026-10-04 |access-info=registration}}
. Retrieved 2026-10-04.
Leading separator (predefined) [info]
{{retrieved/sandbox |access-date=2026-10-04 |pre=yp}}
- . Retrieved 2026-10-04.
Source information (version) [info]
{{retrieved/sandbox |access-date=2026-10-04 |source-info=Revised}}
- Revised. Retrieved 2026-10-04.
Source format (image) [info]
{{retrieved/sandbox |access-date=2026-10-04 |source-format=[[JPEG]]}}
- (JPEG). Retrieved 2026-10-04.
Online provider information [info]
{{retrieved/sandbox |access-date=2026-10-04 |via=[[OnlinePublisherName]]}}
- Retrieved 2026-10-04 – via OnlinePublisherName.
Link note [info]
{{retrieved/sandbox |access-date=2026-10-04 |link-note=brief link note}}
- Retrieved 2026-10-04 (brief link note).
No terminal punctuation [info]
{{retrieved/sandbox |access-date=2026-10-04 |postscript=none}}
- Retrieved 2026-10-04
Optional presentation mode (Citation Style 2) [info]
{{retrieved/sandbox |access-date=2026-10-04 |access-info=registration |source-info=revised |source-format=[[JPEG]] |via=[[OnlinePublisherName]] |link-note=brief link note |mode=cs2}}
, revised (JPEG), retrieved 2026-10-04 – via OnlinePublisherName (brief link note)
All parameters (using short-form aliases)
{{retrieved/sandbox |accessdate=2026-10-04 |pre=y |ai=registration |np=y |si=(revised) |format=[[JPEG]] |df=dmy |via=[[OnlinePublisherName]] |note=brief link note |mode=cs2 |ps=; |msg=y}}
-
(revised) (JPEG), retrieved 4 October 2026 – via OnlinePublisherName (brief link note);
-
Parameters
Listed alphabetically below.
Color legend: Required Default (preset) Dependent/conditional Optional
General notes
The parameter set consists of 12 native parameters; they apply retrieval and link information, source access and type information, presentation options and notification options. Parameters may be required, dependent/conditional, default (preset), or optional.
Dependent parameters and all parameter options are described under their prerequisites. Optional parameters are normally ignored when misspelled, when any prerequisite is absent, or when inserted without a value. Predefined option sets disallow any other input for the related parameter unless specifically stated otherwise.
Included parameters must 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/ai wherever applicable, as it is relevant to reader decisions regarding retrieval.
Incorrect parameter usage may suppress display of related template elements .
Requirements and constraints
- Parameter access-date or its alias accessdate is required.
- Parameter date-format (access date autoformat, alias df) applies only to manually-entered access dates and is ignored when the access date is "quickfilled".
- Parameter np (a specific punctuation instance) is dependent on parameters access-info (access requirement information, alias ai) and source-info (optional source information, alias si).
Parameter options may have additional specific requirements, constraints and conditions.
Description
Access date
- access-date, alias accessdate:
|access-date[accessdate]=full date|ymd|dmy|mdy|sdmy|smdy
- Required; when omitted, misspelled or without a value a notification is displayed and all other template output is suppressed. For basic template usage include only 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.[d] Do not wikilink. Displays after the static text "Retrieved " (the term followed by a non-breaking space).
- Use any one of Wikipedia's citation-compatible date formats, but select any acceptable format established in the edited page's citations or references (WP:DATEUNIFY); when the established format is set by a transcluded
{{use xxx dates}}-class template, access-date/accessdate autodefaults to this format.[c][g] - All-numeric YYYY-MM-DD date format Year-Month-Day requires zero-padded day and month numbers; all others must use non-padded numbering (i.e. 8 September 2026 instead of 08 September 2026).
- Autoinsert today's date: Enter one of the "quickfill" options[e] [examples]
|access-date=ymd– displays as the all-numeric Year-Month-Day.|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 and 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 add a notification.[h]
- Access dates prior to 15 January 2001 (Wikipedia's launch date) will produce a notification.
- The ancillary optional parameter date-format/df may be added to autoformat the display of manually entered access dates .
Access information
- access-info, alias ai:
|access-info[ai]=registration|limited|subscription
- Use when the source has access requirements or restrictions. Select the appropriate predefined option to insert an indicative inline icon/tooltip combination . This parameter's value should ideally display immediately after the external link, and a non-breaking space inserted via parameter pre (or added manually before this template's code). 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– access may be temporary or limited e.g. dependent on number of views, time restrictions, or is partial; 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: Please see Dependents under parameter source-info/si.
Source information, link note
- source-info, alias si:
|source-info[si]=version-related input
- 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/ai [example]
- Dependents:
- np:
|np=y
Dependent presentation parameter. Requires parameters access-info/ai and source-info/si. Removes the default presentation mode punctuation autoinserted between the adjacent outputs of the prerequisite parameters, leaving a single space as their separator [example]. Any input other thanyis silently ignored; if parameter msg is used notifications will be displayed when in error.
- np:
- link-note, alias note:
|link-note[note]=link-related input
Additional information: Source format, online provider
- source-format, alias format:
|source-format[format]=format-related input
- Use 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, the leading separator is white space only. Displays in parentheses before the static text "Retrieved " [example].
- via:
|via=online publisher/provider
- Use to cite the 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, leading separator, presentation mode, terminal & conditional punctuation
- date-format, alias df:
|date-format[df]=ymd|dmy|mdy|sdmy|smdy
- Conditional parameter. Use this parameter to autoformat manually entered access dates. Select one of the predefined options to correctly display the access date in an allowable full 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; either case prevents autoformatting. If parameter msg is used, notifications will be displayed when in error.
- Use of date-format/df is recommended when applicable. It may validate manually-entered access dates and provides a simple way to switch a transclusion's access date format, e.g. in order to follow the display format of the edited page’s citations and/or references (WP:DATEUNIFY)[g] [example]
- Options: Identical to parameter access-date/accessdate "quickfill" options in name and function, see there for descriptions.
[ ymd | 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 or badly formatted date) may be misinterpreted, producing unintended results. The resulting error(s), which may not be immediately obvious, are preceded by a notification.
- pre:
|pre=y|yp|separator-related input
- Recommended. Use to insert a leading separator to the template's output for context, continuity and fully self-contained placement; per recommended practice
{{retrieved}}should follow immediately after the prerequisite wikitext or markup, i.e. an external-link template or other allowable link. This parameter's value is normally the first visible template element. Use one of the related options, or input a desired value. - Options:
|pre=y– set to insert a leading non-breaking space [example]|pre=yp– set to insert leading punctuation as specified by mode, followed by a non-breaking space [example]
- mode:
|mode=cs1|cs2(preset option in bold)
- Default parameter. Applies the 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 all mode output plus the term "Retrieved" will be suppressed by a notification when in error.
- 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 preset 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:
|postscript[ps]=punctuation-related input|none
- Use to replace the presentation mode's default terminal punctuation; insert desired value, or set to
noneto remove terminal punctuation altogether [example].
- np: Use to conditionally remove a specific punctuation instance. Requires parameters access-info/ai and source-info/si .
Notification handling
- msg:
|msg=y
- Optional, intended mainly for testing and debugging purposes; to pre-validate template application, use of this parameter is recommended during preview. Checks select optional parameters (this parameter included) for error conditions and displays related notifications. It also displays maintenance-related notifications for any parameter.
- In addition, notifications for unrecognized parameters (including misspellings) will 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 notifications except the notification for itself; mislabeling the parameter will additionally suppress its own 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.[i] This template may be used to complement select short-citation producing templates, e.g. {{harvnb}} (Template:Harvnb § Adding a URL for the page or location).
In the example below, the in-source location has more-retrictive access than the source in general.
- Example:[f]
A wikitext statement.<ref>{{harvnb |AuthorLast |2026 |pp=[https://www.example.com 23–24]}}{{retrieved/sandbox |pre=y |access-info=subscription |access-date=2026-10-04}}</ref>
=== Notes ===
{{reflist}}
=== References ===
{{refbegin}}
* {{cite journal |author-last=AuthorLast |date=October 2026 |title=ArticleTitle |journal=JournalName |issue=5 |pages=21–35 |url=https://example.com |url-access=limited |access-date=2026-10-04}}
{{refend}}- Generates:
Notes
- ↑ AuthorLast 2026, pp. 23–24
. Retrieved 2026-10-04.
References
- AuthorLast (October 2026). "ArticleTitle". JournalName (5): 21–35. Retrieved 2026-10-04.
Errors and notifications
The template handles several types of error and maintenance conditions, including fatal errors, usage-related issues, constraint violations and unrecognized parameters. The conditions (and/or the notifications) may suppress display of related template elements; certain usage errors may not be immediately obvious .
Fatal errors stop template processing and the related notification message suppresses any other template output. Non-fatal notifications display before other output.
Notifications are generated by required parameter access-date/accessdate and by optional parameters access-info/ai, date-format/df, mode, np and msg.
Error 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.
Notifications for optional-parameter errors, for maintenance issues regarding any parameter, and for unrecognized parameters are not displayed by default; the input error values and in some cases the error conditions are ignored. Parameter msg may be used to display these notifications; when msg itself is in error its message or condition suppresses all other 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 incorrectly formatted ! | [info] |
| E12 | [usage error] | ! Access date format is invalid ! | [info] |
| E13 | [constraint] | ! Access date is invalid future value ! | [info] |
| E14 | [constraint] | ! Access date is invalid past value ! | [info] |
| E15 | [usage error] | ! Access date format is invalid – parameter date-format/df may be misapplied ! | [info] |
| E21 | [usage error] | ! Access information option is invalid ! | [info] |
| E31 | [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/si ! | [info] |
| E44 | [constraint] | ! Parameter np requires parameter access-info/ai ! | [info] |
| E101 | [usage error] | ! Parameter msg value is invalid ! | [info] |
| No. | Type | Message | Link |
|---|---|---|---|
| N01 | [usage] | ! Unrecognized parameter name <parameter name> ! | [info] |
| N02 | [maintenance] | ! Date format is superfluous (autoinserted access date) ! | [info] |
Categorization
- Category:Template Retrieved errors – date-related errors add the edited page to this category
- Category:Pages containing links to subscription-only content – applied to the edited page via a parameter access-info/ai option
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, and to other allowable external links; insert it as close as possible to the related link. The template follows Wikipedia citation-template guidelines, with variations. All date input must be in one of Wikipedia's citation-compatible 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' 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 manually enter a full date, displays as entered or in the format set by select pre-existing date formatting templates; all-numeric date formats require zero-padded day and month numbers. 'Access date format' may be used to validate/autoformat manually entered dates
| String | required |
| Access information | access-info ai | Recommended when the source has access restrictions. Select the relevant dropdown list option or type it in (lowercase); it displays 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 for date validation otherwise. Select a dropdown list option or type it in (lowercase)
| String | suggested |
| Leading separator | pre | Use to add a leading separator from preceding markup or wikitext; it displays first in the template's output. Enter (in lowercase, no quote-marks) or select from the dropdown list option 'y' to insert a non-breaking space only, 'yp' to insert leading punctuation (according to the 'Presentation mode'), followed by a non-breaking space; alternately type in a preferred separator
| String | suggested |
| Source information | source-info si | Use only when additional citable information specific to the retrieved version is needed for clarity; displays after 'Access information' | 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 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 notifications about select optional parameters, and all maintenance notices; 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 wiki's current timestamp to format dates (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).
- 1 2 Module
{{#invoke:auto date formatter}}is utilized to apply{{use xxx dates}}conformance. As of September 2025,[update] the relevant templates in this class were{{use dmy dates}}and{{use mdy dates}}. - 1 2 Retrieval information must apply to the specific wikitext (WP:TSI). The retrieved material's overall relevance to the edited page's subject, or its reliability, is beyond the template's scope.
- 1 2 Today's date is substituted using the relevant parser function.
- 1 2 Categories are suppressed in examples that would otherwise categorize this page.
- 1 2 Parameter date-format/df options or quickfill options that result in access date formats different than the one specified by
{{use xxx dates}}-class templates will override the article default; such use is contrary to date-consistency guidelines. - ↑ 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 any related short citations. In-source locations may have specific access and/or retrieval requirements, and specific external-link state or status. In addition the short citation's text-source integrity and accessibility may require specific retrieval information.