Community Central
Community Central

Template substitution is an alternate way to embed information contained in a template. Substitution is performed by placing the code subst: between the template braces, before the template name, like this:

{{subst:Templatename}}

How does substituting work?

Normally, a template named {{something}} will appear to expand to whatever is at [[Template:Something]] when the page is saved, but if you edit the page you will still see {{something}} in the wikitext.

However, if you substitute a template, the text "{{subst:something}}" will actually be replaced with whatever is at [[Template:Something]]. If you edit the page again after saving, you will no longer see {{subst:something}} in the text.

Why would I want to substitute instead of using a template directly?

One reason is that substituting a template reduces the load on the server - however, as this can defeat the objective of having a template in the first place, you may want to ignore it :)

A better reason is for things like welcome templates. Substituting these can be a good idea because welcome templates may change over time, and it can be odd to have someone's talk page change long after they have seen the notice. In addition, substituting it can give a better impression, as actual code can look more "human" than text saying {{welcome}}.