This help page is ahow-to guide. It explains concepts or processes used by the Wikipedia community. It is not one ofWikipedia's policies or guidelines, and may reflect varying levels ofconsensus. |
| Linking and page manipulation |
|---|
Importing and copying |
Apiped link is an internallink that displays text different from the title of the page to which the text links. It is created withwikitext (markup code) that results inhyperlinked (underlined, clickable) text. It is called "piped" because it uses thepipe character ("|") or vertical bar.
For example, the wikitext[[train station|station]] displays asstation but it links to the Wikipedia article abouttrain stations.
Do not confuse piped links and redirects: they are two very different mechanisms. Both allow the displayed text of a link to differ from the title of the final destination page (the page that a reader will see after clicking that link). However, a piped link conceals the destination page's titleonly in that single line on the single page where its wikitext is used, while on any page throughout Wikipedia any link, piped or not, to a specific redirect page will always lead to the same destination page.
Piped links are useful for preserving the grammatical structure and flow of a sentence when:
cetaceans have been extensively [[hunt]]ed by [[humans]] for their [[whale meat|meat]], [[blubber]] and [[whale oil|oil]]), orThe pipe ("|") character is also known as avertical bar.
There are two ways to create the pipe ("|") character: using the keyboard or choosing from a list of symbols. On English-layout keyboards, you may press⇧ Shift+\. On Spanish keyboards, the pipe character can be obtained by pressingAltGr+1. On French (AZERTY) keyboards, the pipe character can be obtained by pressingAltGr+6. Or note that, when you are in "edit this page" mode, the "pipe" appears as the third character in the "Wiki markup" section at the bottom of the page, among the list of symbols. (You may need to choose "Wiki markup" on the pull-down menu.) Clicking on the pipe symbolthere inserts it at the cursor spot, just as happens for any symbol chosen from this page.
For full details on how to use this feature, seeHelp:Piped link.
First of all, keep links as simple as possible:
N[[George Washington|President George Washington]]
YPresident [[George Washington]]
N[[Wolfgang Amadeus Mozart|Mozart]]
Y[[Mozart]]
[[Leningrad]] currently redirects toSaint Petersburg, but one day it could be decided to spin off a dedicated article about the old city of Leningrad; when that happens, all existing links[[Leningrad]] will automatically point to the correct article, while the unnecessarily piped ones[[Saint Petersburg|Leningrad]] will point to the wrong place.
N[[public transport|public transportation]]
Y[[public transport]]ation
N[[Public transport|public transport]]
Y[[public transport]]

Keep piped links as transparent as possible and follow theprinciple of least astonishment. Do not use piped links to create "Easter egg" links that require the reader to open them (or, at least, to hover their mouse pointer on those links to getpage previews in the form ofnavigation popups) before understanding where they lead.
Also remember there are people whoprint the articles. For example, do not write this:
... and by mid-century the puns and sexual humor were (with only a few [[Thomas Bowdler|exceptions]]) back in to stay.
The readers will not see the hidden reference toThomas Bowdler unless they click or hover over the pipedexceptions link. In a print version, there is no link to select, and the reference is lost. Instead, reference the article explicitly:
... and by mid-century the puns and sexual humor were (with only a few exceptions, such as [[Thomas Bowdler]]) back in to stay.
Similarly, instead of:
After an [[1944 Bombay explosion|earlier disaster]] ...
consider:
After an earlier disaster, the [[1944 Bombay explosion]], ...
or simply:
After the [[1944 Bombay explosion]], ...
It will occasionally be useful to link to a fuller explanation of a phrase; when this is done,link the phrase, not a single word.
For example: If Pontiac's War is defined as having been
and there is no space for further explanation in that context (this is a quote from the lead of the article), then some readers will value a link to a description of the confederation. This shouldnot be linked from the word confederation; the link in the following phrase:
looks like a link to the articleConfederation.
At a minimum, link something that, obviously, wouldn't be the title of an article underour article title conventions:
Further, it is inappropriate to containveiled and uncitedinterpretations of fiction through piped links, as in this excerpt from theThe Iron Dream article, which contained over 30 interpretations of the book's allusions hidden in links:
... and in wikitext:
The pure and strong young [[breeding true|"Trueman"]] (so named for the lack of mutations in his [[DNA]]) Feric Jaggar returns from the outlands of [[Austria|Borgravia]] where his family was exiled by the [[Treaty of Versailles|Treaty of Karmak]] with the [[Allies of World War I|surrounding mutant states]] ...
Such interpretation, ifproperly sourced, should be placed in its own section and citations provided. If the interpretation is purely that of the editor, it isoriginal research and should be removed.
Thepipe trick uses thepipe character ("|") to automaticallyconvert the label of a piped link for several kinds ofwikilinks. This saves time and avoids potential errors. When the last character of a link is the pipe character, the software will remove the parenthesized part of the title andnamespace prefixes and handle commas in the title. This processing happens after clicking "Publish", and the generated text is saved with the rest of the page'swiki markup. Just like for the three or four tildes when signing on Talk pages and the use ofsubst, in a preview, the result already shows up in the preview itself, but the conversion in the edit box is not yet shown. Press "Show changes" to see the change in the wikitext:
The pipe trick does not work in edit summaries, within<ref> tags, or with section links. In cases where the pipe trick doesn't work, the link has to be written out in full manually:
<ref>[[Roger Taylor (author)|]]</ref>[1] renders in the references list as/* Section */ as tested in [[WP:SAND|]] renders in the edit history as→Section: as tested inWP:SAND[[Wikipedia:Verifiability#Sources|]] renders as [[Wikipedia:Verifiability#Sources|]]Article titles:
Pages in other namespaces:
[[Wikipedia:Verifiability|]] results inVerifiability[[User:Example|]] results inExample[[Template:Welcome|]] results inWelcome.{{tl|Welcome}} to produce{{Welcome}} is preferred instead.[[:Category:Wikipedia|]] results inWikipedia. The colon avoids categorization of the page.[[Category:Wikipedia|]] should not be used.[[Category:Wikipedia| ]] with a space after the pipe is acategory sortkey and not the pipe trick.As with all links, it is possible to blend a suffix when using the pipe trick as well:
[[pipe (computing)|]]s generates the wiki markup[[pipe (computing)|pipe]]s rendered aspipes[[pipe (computing)|]]mill generates the wiki markup[[pipe (computing)|pipe]]mill rendered aspipemillWith colons:
[[Help:Template|]] is converted to [[Help:Template|Template]], which is rendered asTemplate.[[Music: My life|]] is converted to [[Music: My life| My life]], which is rendered as My life – although "Music:" is not a namespace (therefore the space after the colon is not automatically removed), the shortcut works anyway.[[w:en:Pipe (computing)|]] is converted to [[w:en:Pipe (computing)|en:Pipe]], which is rendered asen:Pipe.With case:
[[pipe (computing)|]] is converted to [[pipe (computing)|pipe]] which is rendered aspipe.[[Pipe (computing)|]] is converted to [[Pipe (computing)|Pipe]] which is rendered asPipe.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 parenthesized term (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.
Since Wikipedia is case-insensitive in regard to the first character of the target title, it is possible to use the pipe trick for upper- or lowercase words regardless of the target page's case. The sort key syntax of the category being like a piped link, the pipe trick also works for category tags, even though it is not useful there.
In case of combinations of suppressible parts, the following rules apply:
[[Yours, Mine and Ours (1968 film)|Yours, Mine and Ours]] is shown on the page as:Yours, Mine and Ours[[:es:Wikipedia:Políticas|Wikipedia:Políticas]] is rendered as:Wikipedia:Políticas[[Elgin, Kershaw County, South Carolina|Elgin]] results in:Elgin[[Wikipedia:Manual of Style (Persian)|Manual of Style]] produces:Manual of StyleOther examples:
[[commons:Boston, Massachusetts|]] is converted to [[commons:Boston, Massachusetts|Boston]], which is rendered asBoston.[[w:{{{1}}}|]] doesnot give [[w:{{{1}}}|{{{1}}}]].[[w:en:{{FULLPAGENAME}}|]] doesnot give [[w:en:{{FULLPAGENAME}}|en:{{FULLPAGENAME}}]].[[m:{{FULLPAGENAME}}|]] doesnot give [[m:{{FULLPAGENAME}}|{{FULLPAGENAME}}]]| Wikitext | Displays as |
|---|---|
[[project:a (b)|]] | a |
[[w:project:a (b)|]] | project:a |
[[:de:project:a (b)|]] | project:a |
[[wiktionary:project:a (b)|]] | project:a |
[[wiktionary:de:project:a (b)|]] | de:project:a |
[[wikibooks:project:a (b)|]] | project:a |
[[wikiquote:project:a (b)|]] | project:a |
[[wikisource:project:a (b)|]] | project:a |
[[w:en:{{FULLPAGENAME}}|]] | [[w:en:Wikipedia:Piped link|]] |
[[w:en:{{FULLPAGENAME}}|en:{{FULLPAGENAME}}]] | en:Wikipedia:Piped link |
[[m:{{FULLPAGENAME}}|]] | [[m:Wikipedia:Piped link|]] |
[[m:{{FULLPAGENAME}}|{{FULLPAGENAME}}]] | Wikipedia:Piped link |
If the title of the article you are editing includes a parenthesized term or a comma, placing a pipe at thestart of a link will append that parenthesized text to the link target, but not display it. This is called thereverse pipe trick.
[[|B]] is automatically converted to[[B (c)|B]].For example, if the link[[|Agonizer]] were placed inAgonist (disambiguation), the link would be expanded to[[Agonizer (disambiguation)|Agonizer]].[[|B]] is automatically converted to[[B, c|B]].For example, if the link[[|Palo Alto]] were placed inPacific Grove, California, the link would be expanded to[[Palo Alto, California|Palo Alto]].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.
You can achieve a similar effect forsubpages by adding a trailing slash. For example, on the pageWashington, typing[[/State/]] generatesState, which links toWashington/State. Without using the slash trick,[[/Subpage]] becomes/Subpage. However, unlike the pipe trick, theslash trick is not expanded in the savedwiki markup.[clarification needed] The slash trick only works in namespaces where subpages are enabled.
In the case of acategory link, a piped link overrides the alphabetical sort order of the article, as shown on the linked category page.
For example, in a hypothetical new articleAlbert Einstein, using[[Category:Quantum physicists]] places him inCategory:Quantum physicists. And that category page will list him as "Albert Einstein". But if this link is used in this simplest form, it will list the title (lemma) among the "A"s, instead of the "E"s (where he belongs), because it sorts on the article's name, "Albert Einstein".
One way to impose correct sort order is to use[[Category:Quantum physicists|Einstein, Albert]], which makes that category page list "Albert Einstein" among the "E"s, by sorting itas if it were "Einstein, Albert" rather than "Albert Einstein".
However, theactualAlbert Einstein page has dozens of category links. Piping every category link would be unattractive. As is standard for most "person" pages, that page uses thetemplate{{DEFAULTSORT:Einstein, Albert}} to override the default sorting for category links. Thus[[Category:Quantum physicists]] on that page, places him inCategory:Quantum physicists as "Albert Einstein",and makes that category page sort him as "Einstein, Albert", without need of a piped link, and likewise for other category links.
But because of this template that pageneeds topipe the category link,[[Category:Einstein family|Albert]], to place him inCategory:Einstein familyand make (only) that category alphabetize him under "Albert".
The pipe character is also used when supplying parameters totemplates; this is not the same thing as a piped link.
Some templates automatically add link formatting,as seen here with the previous_awards field. Those automatic links won't work with the normal piped links; for them, instead of a normal pipe, use the magic word{{!}},as seen here with the current_awards field.