Wikipedia:Template substitution 

This page lists templates that should always or should never be substituted except in the Wikipedia namespace. Automated tools (bots) that do such replacements will never be used on the original template pages.

If you are going to use a bot to substitute templates, please read through the talk page first, as many are under dispute or change status over time, and substitution is permanent.

Contents

About subst

Definition

The subst: keyword (short for "substitution") is used as a prefix inside template code. It changes the way the software expands the template. Ordinarily, a template will be expanded "on the fly"; that is, the template code calls a separate page for the text every time someone edits a page it is used on. When someone edits a page with a normal template call, they see the template call. Placing "subst:" inside the curly brackets tells the software to permanently replace the template with the text of the template (i.e., the text that is on the template's article page when the template is added to the page). Therefore {{template}} becomes {{subst:template}}, until you save the page. The next editor sees not the template call, but the text of the template when you saved; it does not change even if the template is edited.

Usage

You can subst a template tag by adding "subst:" to a template tag. For example, use {{subst:test5}} instead of {{test5}}.

When this is a major component of an edit, it is strongly suggested that the template be mentioned in the edit summary (for instance, put "{{subst:test}}", "subst:test" or "test1 applied" in your edit summary) so other editors can easily see what you have done.

Additionally, when creating or editing templates that are commonly substituted, adding an HTML comment to the template page helps article editors to see how templates are being used (e.g. <!-- Substituted from Template:Doctl -->).

Benefits of substitution

Drawbacks of substitution

Templates that should be substituted

This is a list of templates that should always be substituted, organized by namespace. Each list is ordered alphabetically with grouped series.

Article namespace

Article talk

User talk namespace

All of the templates listed in Category:User warning templates should be substituted.

Image namespace

(none listed)

Deletion-process documentation

Misc. templates

Uncategorised suggestions

Templates that must be substituted

These templates have a purpose and/or syntax that require them to be substituted.

Templates that should not be substituted

Technically, templates shall not be substituted that

(a) contain calls to ParserFunctions (#if, #switch, etc.), unless, where possible, these are substituted too (see m:Help:Substitution#Multilevel_substitution)
(b) template calls that do leave some parameters to their defaults by not specifying them, unless the alternative default mechanism is used
because those constructs are not replaced in the generated wiki-code (Single level substing of case (a) leaves the #if or #switch constructs verbatim at the subst location and (b) leaves constructs like "{{{1|default value}}}").
If specific consensus is to eliminate a particular call of such a template, Special:ExpandTemplates can be used to expand that call to plain wiki-syntax.
(c) templates that contain external links as the formatting of the URL to perform queries or look-ups may change.

List

This is a list of templates that should not be substituted. This is because they can either contain formatting standard code, contain complex code, or contain code that breaks if substituted.

Wrong title templates

These templates -- used in the main-space -- add a comment about why an article is misnamed. The categories for these templates are being removed because they create a self-reference. Once the categories are removed, the "What links here" tool can be used to find all transclusions of the template. They should not be subst'd, because it will remove this method of finding where it is used.

Note that hidden categories could now be used for purposes such as this.

Chemical abbreviations

See Category:Chemical element symbol templates. These are used to simplify the entry of chemical formulae.

Deletion-related

Most templates related to renaming or deleting pages are used temporarily, and thus do not need to be substituted (it just makes more work to delete them).

Exceptions: The following templates must be substituted in order to work correctly:

In addition, those templates which document a finished deletion process ({{afd top}}, etc.) should be substituted.

Standardised appearance templates

These templates are intended to standardise the appearance of pages across a system of pages, and should not be substituted as doing so would make it prohibitively labour-intensive to edit them.

Under debate

See also