Help:Pipe trick

The pipe trick uses the pipe character ("|") to save typing the label of a piped link for several kinds of wiki links. This can help avoid 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. It removes any part of the link title that is inside parentheses, but it also processes commas in the title, and namespace prefixes (e.g., "Help:"). The generated text is saved with the rest of the page's wiki markup.

The pipe trick does not work in change summaries, within <ref> tags, or links to sections – see below.

Examples

Article titles
  • [[Character (computing)|]] generates Character
  • [[Boston, Massachusetts|]] generates Boston
Pages in other namespaces
Combinations

If the link name involves both one or more commas and a final parenthesis, only the parenthesis is suppressed:

  • [[Pinocchio (1940 movie)|]] is shown on the page as Pinocchio

If there are several prefixes, which can occur, for example, for an interlanguage link, only the first is suppressed:

If there are several commas, only the part up to the first comma is shown:

  • [[Il Buono, il Brutto, il Cattivo|]] results in Il Buono

For the rest, if there is both an initial part and a final part that can be omitted, both are suppressed:

  • [[Wikipedia:Notability (music)|]] produces Notability

Where it doesn't work

In some cases, the pipe trick does not work, and the link must be written out in full manually. The trick does not work when enclosing between <ref></ref> tags or <gallery></gallery> tags. It also does not work in change summaries.

The pipe trick does not work with section links, and in general it does not work for links to anchors (links that use a # sign). For example, [[Wikipedia:Verifiability#Sources|]] does not give you any wikilink.

Slash trick

You can achieve a similar effect for subpages by adding a slash.

Unlike the pipe trick, though, the slash trick is not expanded in the saved wiki markup.

This trick only works in namespaces where subpages are enabled.

Reverse pipe trick

If the title of the article you are editing includes a term in parentheses or a comma, placing a pipe at the start of a link will add that text to the end of the link target, but not display it.

For example, if the link [[|Brush]] were placed in Broom (disambiguation), the link would be expanded to [[Brush (disambiguation)|Brush]]

Placing a pipe at the start of a link to an article that has no parentheses or comma in its title will have no effect.

Content Disclaimer

Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.

  1. The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
  2. There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
  3. It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
  4. Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
  5. Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.