Transclusion means the inclusion of the content of one document within another document by reference. In Wikipedia transclusion, the MediaWiki software will refer to the content of one page, the template, for inclusion into the content of any other page, the target page. Similar to the way any page name can become a link by placing its name in double square brackets, any page name can become a template by placing it in double curly braces, is transcluded once but never again, because the wikitext of that call is replaced (substituted) when its page is saved. What was a one-time template call becomes the actual wikitext of the template at the time of its call.

How transclusion works

To transclude any source page (within a single MediaWiki project, such as en:Wikipedia), include the following code in the target page:

Whenever the target page A with this code is rendered, the engine will include in that place not the code itself, but the entire content of the source page B, SOMEPAGE. The top row shows what the target page renders as, while the bottom row shows the code. Note: foo will not be highlighted nor boxed on the target page.


For example, you might decide to place a welcome message on every newcomer's talk page.

Transclusion creates a "live" link between the template page and the target page(s) upon which the template's contents should appear. When the template is edited, the rendering of that template on the target pages is updated as well. For example, you create a (template) page in Wikipedia with your home mailing address and then transclude that template not only on your page, but all your friends' pages, too. Later, after moving to a new house, you then update your address template and the new address will automatically appear on all your friends' pages.

There are further simple examples at mw:Transclusion.