The pipe trick uses the pipe character ("|
") to save typing the label of a piped link for several kinds of . This can avoid potentially making an error while typing the label.
When the last character of a link is the pipe character, the pipe trick will automatically generate the text that displays for that link. Its processing removes the parenthesized part of the link title, handles commas in the title, and removes namespace prefixes. The described processing happens at the point of saving the page data, and the generated text is saved with the rest of the page's – thus, it is merely an aid to editing.
An even better way to save keystrokes that doesn't need any additional character is by simply attaching text to the link, as in "[[train]]s".
The pipe trick doesn't work in edit summaries, within <ref> tags, or links to sections – see below.
Article titles
Pages in other namespaces
As with all links, it is possible to blend a suffix when using the pipe trick as well:
The basic rule when the pipe trick is used is that an (initial) namespace prefix, a final part beginning with a comma, or a final parenthesis (usually intended for disambiguation) is suppressed in the rendering of the link. The rendered text is case neutral and so should be entered precisely as the user wishes it to appear in the article. In case of combinations of suppressible parts, the following rules apply:
If the link name involves both one or more commas and a final parenthesis, only the parenthesis is suppressed:
is shown on the page as:
If there are several prefixes, which can occur, for example, for an interlanguage link, only the first is suppressed:
is rendered as:
If there are several commas, only the part up to the first comma is shown:
results in:
For the rest, if there is both an initial part and a final part that can be omitted, both are suppressed:
produces:
Where the pipe trick doesn't work, the link must be written out in full manually.
The trick does not work when enclosing between "ref" tags or gallery tags.
renders in the references list (generated by the <references/> tag) as: