Product Code Database
Example Keywords: playbook -grand $82
barcode-scavenger
   » » Help: Link
Tag Help 'Link'.
Tag

This page, Help:Link explains how to make wikilinks, interwiki links, or external web links (as ) in Wikipedia, which give readers one-click access to other Wikipedia pages, other Wikimedia projects, and external websites.

For a short list of some basic shortcuts, see .

For guidelines on how links should be used in Wikipedia, see .


Wikilinks
A wikilink (or internal link) links a page to another page within English Wikipedia. Links are enclosed in doubled square brackets like this:
  • [[abc]] is seen as "" in text and links to page "".
Use a "|" (the "pipe" symbol – see for how to type one) to create a link while labeling it with a different name on the original page. The first term inside the brackets is the link (the page you would be taken to), while anything you type after the vertical bar is what that link looks like on the original page. Here are some examples:
  • [[a|b]] is labeled "" on this page but links to page "".
  • [[a]]b gives . So does [[a|ab]]: . [[a|b]]c gives , just like [[a|bc]] does. However, all four of these examples will link to page "".
  • a[[b]] gives a.
  • [[a]]:b gives :b since the colon is outside the end brackets. The same goes for [[Washington]]'s or e-[[mail]].
  • [[a]]''b'' gives b. (Double single quotes turn on and off italics.)
  • ''[[a]]''b gives b.
  • [[a|b]]cd gives .

Links with a specified label are said to be "" because the pipe symbol is used ("|"). For certain types of link, the label will be generated automatically if a pipe is typed, even with no label after it (meaning you don't have to type one). See .

The link target is case-sensitive except for the first character (so [[atom]] links to "" but [[ATom]] does not). Other ways in which link targets are reinterpreted are described below under: .

If the target of a wikilink does not exist, it is displayed in red color, and is called a "". If a red link is clicked, the user is taken to a blank page where it is possible to create a page using that redlinked title. While on that blank page, other red links to this (non-existent) title can be detected using the "" feature.

If the target of a link is the same as the page on which it appears (a ), it is displayed in bold font, as with: .

Attempting to link normally to an page, page or will produce a different effect: this will respectively place the image on the page, add the page to the category, or create an interlanguage link at the edge of the page. To override this behavior, add an initial colon ":", as in <nowiki></nowiki>, <nowiki></nowiki>, <nowiki></nowiki>.


Interwiki links
An links to a page on another Wikimedia project website, such as or another language Wikipedia. The target site must be on the specified for the source wiki. These links have the same [[:File:Mediawiki.png]] syntax as wikilinks (see above), but take a prefix ":x:" which specifies the target site.

For example, [[:Category:Help]] links to the "Help:Link" page on Meta, while [[:fr:Help:Link]] links to page "Athens" on as: .

Interwiki links can be piped, just as with wikilinks. Remember that an should be preceded by a colon if it is to be displayed, where it is inserted in the text, as an ; otherwise it will be displayed in the list of interlanguage links at the side of the page (which is appropriate only if it is the most closely corresponding page in the other-language Wikipedia). Thus (incorporating the ), [[...]] would be used to link to Wikilink on Japanese Wikipedia. Example: ([[m:Help:Link]] links to on Japanese Wikipedia).

Interwiki links (like external links) are displayed in a slightly paler blue than ordinary wikilinks. The page formatting does not detect whether these target pages exist, so they are never displayed in red.


External links
External links use absolute to link directly to any webpage. These links have the associated CSS class "external". External links are in the form <nowiki></nowiki> (resulting in link name), with the link name separated from the URL by a space and followed by an . Links without link names appear numbered: <nowiki></nowiki> becomes: . Links with no square brackets display in their entirety: http://www.example.org.

See for more detailed information.

finds all pages linking to a given site.

The external link syntax can also be used to link to particular page versions within Wikipedia that are not accessible by wikilinks, such as , edit view, an old version of a page, the between two versions, etc. It can also be used to create a .

To display a link without the arrow icon, place the external link syntax between <span class="plainlinks">...</span> tags.

Registered users at the English Wikipedia can select "Open external links in a new tab/window" under Gadgets at . It is not possible to make an external link open in a new tab/window for others.


Dropping http: and https:
If you make an external style link using square brackets [[:commons:Athens]] from a Wikimedia page to other Wikimedia page, including Wikipedia of course, it's better to drop the protocol http: or https:, so that the URL begins with //..., e.g. //en.wikipedia.org/w/index.php?title=Help:URL.

Otherwise, readers are forced to use the specified connection method. If you don't specify the protocol, readers can continue to use the protocol to read that page.

The URL returned by begins with //.

  • Example: [[:ja:Wikilink|]]
  • Result: //en.wikipedia.org/w/index.php?title=Help:Link (Read this page both with http and https.)


What is an "anchor"?
An "anchor" is a landing place for a link to jump to. The process involves the wiki-software automatically creating usually-invisible code from certain text in the "landing place", such as certain parameters in reference templates. In Wikipedia, the term "anchor" may refer to the landing place in general, to usually-invisible code, or to the text and parameters from which the code is created.


Section linking (anchors)
To link to a section in the same page, you can use: [[:ja:URL|]], and to link to a section in another page: [http://www.example.org link name].

The section title in fact points to an anchor on the target page. It to define , using the code <nowiki></nowiki>, or the template <nowiki></nowiki> (see syntax). To create an anchor for a row of a table see . However <nowiki></nowiki> and <nowiki></nowiki> are reserved names that link to the top of a page and the table of contents, respectively.

Section links still work if the wikilink is a (for example, if redirects to , then will link to the "History" section of the article Gdańsk). It is also possible to put section links inside redirects (these work only if JavaScript is enabled). For example, redirects to using <nowiki></nowiki> processing. Note that an explicit section link overrides any section link in a redirect, so will go to the "Interwiki links" section of this page.

For more information, see . See also .

Anchor links can also be added to external URLs and to interwiki links, again using the # syntax. Note that if the page name is automatically converted, then the section link still works, but disappears from the address bar (this makes it more difficult to bookmark the section itself).


Subpage links
Except in main (), where the has been disabled in the English Wikipedia, are pages separated with a "/" (a ) from their 'parent' page.

Inside a subpage hierarchy the following relative links can be used:

  • [http://www.example.org] links to the parent of the current subpage, e.g., on A/b it links to A, on A/b/c it links to A/b.
  • [...] links to the grandparent of the current subpage, e.g., on A/b/c it links to A.
  • [//en.wikipedia.org/w/index.php?title=Help:Link no protocol] links to a sibling of the current subpage, e.g., on A/b, it links to A/s.
  • [[#section name|displayed text]] links to an "uncle" of the current subpage, e.g., on A/b/c, it links to A/s.
  • [[page name#section name|displayed text]] links to a subpage, e.g. on A it is the same as <span id="anchor_name">...</span>. Because of this, linking from a namespace where the subpage feature is enabled to a page in the main namespace with a name starting with "/", requires a workaround: put a colon before the pagename.

Linking to an of an ancestor does not work. Attempting it gives a link to a page with the name consisting of the name of the ancestor followed by "/".

Relative links still work if all pages of a tree are renamed according a name change of the root, including making it a child of a new root.

See also the example pages and .


ISBN, RFC and PMID automatic links
Links to these items are generated automatically, with no need to insert square brackets:
  • codes automatically generate links, for example: the wikitext <nowiki></nowiki> becomes ISBN 978-0-12-345678-9 which corresponds to .
  • <nowiki></nowiki> becomes RFC 4321, which is the external link to the standard at: <nowiki></nowiki>
  • <nowiki></nowiki> becomes PMID 12345678, which links to a reference in the medical literature at .
To prevent such automatic linking, use <nowiki>...</nowiki> tags around the text.


Piped link
A piped link is an internal or where the link target and link label are both specified. This is needed in the case that they are not equal, while also the link label is not equal to the link target with the last word extended. This allows linking a word or phrase within the text of a page rather than using "see also", even if the wording does not exactly correspond with the name of the target page. With a suitable browser and depending on the set, one can still see the link target: when you point at the link, the name shows up in a hover box and is also shown in the status bar.

For instance:

{{Anchor|anchor name}}
will show:

Another example would be [[#top]] rendering as . This is useful where the word "station" is used in an article on trains; from the context, it would be clear that a train station is meant. The piped link is more convenient to the user than a link to which might be a disambiguation page.

The term piped refers to the use of the pipe character "|" used to separate the good description from the actual link. This character is named after an alternative use of it; see .


Using a redirect as an alternative
An alternative is simply using . To create , use [[#toc]] and make this a redirect to (note that, unlike above, what pops up when you point at the link, if applicable for your browser, is simply the text already shown).

This is convenient if the redirect is already there or will also be of use elsewhere; however, there are a few drawbacks:

  • the popup does not show the page one will arrive at
  • "" gives the changes in the redirect page not the redirect target
  • the redirect message on the target page slightly clutters it

Combining a piped link and a redirect, one can provide some information that is not the name of the page one links to in the hover box, such as the value of a unit in terms of other units. In that case one can make a page whose pagename is the info one wants in the link title, and which redirects to a page with a more appropriate name. See e.g. , containing #redirect, with the page redirecting to .


Automatic conversion of the wikitext

Pipe trick
If in a piped link the part after the "|" is left empty, it is to an abbreviated form of the page name on the left, as follows:

  1. any word before the first colon (:), as well as the colon itself, is removed. This word may or may not be a namespace prefix (such as "Help:") or an interwiki prefix (such as "commons:"). If the page name is preceded by a colon, "first" refers to "first after this".
  2. if there is text in parentheses at the end it will be removed
  3. if there are no parentheses but there is a comma, the comma and everything after it is removed
  4. the link will be in whatever case is used.

Just like for the three or four tildes when signing on Talk pages and the use of subst, 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.


Examples

Colon
  • [[../]] is converted to [[../../]], which is rendered as .
  • [[../s]] is converted to [[../../s]], which is rendered as - although "Music:" is not a namespace (therefore the space after the colon is not automatically removed), the shortcut works anyway.
  • [[/s]] is converted to [[A/s]], which is rendered as .


Case
  • ISBN 978-0-12-345678-9 is converted to RFC 4321 which is rendered as .
  • http://tools.ietf.org/html/rfc4321. is converted to PMID 12345678 which is rendered as .

Comma
  • [[coffeehouse setup|How to set up a coffee house]] is converted to [[train station|station]], which is rendered as .

Other
and :
  • [[How to set up a coffee house]] does not give [[30.48 cm|ft]].
  • : Calling the template with a value of parameter 1 gives a working link in the case of substitution only.
  • [[Help:Template|]] does not give [[Help:Template|Template]].
  • : [[Music: My life|]] does not give [[Music: My life| My life]]
See also below.

     

Which looks like:


Category tag
The sortkey syntax of the category being like a piped link, the pipe trick also works for category tags, even though it is not useful there.


Limitation
  • [[w:en:Pipe (computing)|]] using is not converted, so the result is rendered as and not as a working link. This is because the pipe trick expansion, like substitution, occurs before ordinary expansion of templates, etc., while the pipe trick does not work if the linked page contains invalid characters. Thus while ordinarily the acceptability of the target page name is judged after template expansion, the pipe trick expansion judges it before, the braces are considered invalid characters in the page name. Instead one can use a template like : [[w:en:Pipe (computing)|en:Pipe]] gives .


Inverse pipe trick
On page "A (c)", [[pipe (computing)|]] is automatically converted to [[pipe (computing)|pipe]].

Similarly, on page "A, c", [[Pipe (computing)|]] is automatically converted to [[Pipe (computing)|Pipe]].

For examples, see .


Changing link appearance
The ways that various links are displayed in browsers, as described above, are the default display styles in the default . Users can change the way they see links:
  • By selecting a different skin;
  • By applying a using CSS;
  • By changing the "Underline links" or "Format broken links like this" value on the Appearance tab of ;
  • By setting the "threshold for stub display" on the Appearance tab of user preferences. This causes links to pages in mainspace to be displayed in a distinctive fashion – dark red by default – if the wikitext of the target page has less than a specified number of bytes. (Any section markers in the link are ignored. Links to redirects are displayed in the normal style).


Hover boxes
In many browsers, holding the cursor over a link () shows a hover box () containing the text of the link's HTML title attribute. MediaWiki sets this to the target page name (without any section indication) if it's a wikilink, the page name with prefix if it's an interwiki link, and the URL if it's an external link. (This can be switched off in the .) The browser may also show similar information, including any section indication, in the address bar.

For these effects a piped link is useful even if it is not followed; for example, for displaying the meaning of an acronym. It is possible to produce a hover box without a link, using the template.


Disallowed characters
A link whose target contains disallowed characters (see ) will be displayed without markup, as in .

Conversions are automatically made to in wiki and interwiki links. For example, "<nowiki></nowiki>" becomes "". However, the opposite is true for external links; literal characters are converted into non-literal characters. For example, most browsers convert ".../wiki/!" to ".../wiki/!".

A code like p in a redirect disables it, although the link works from the redirect page. For a redirect that works, the redirect page shows the canonical form of the target, unlike its preview page, which renders the link in the usual way.


Links containing URL query strings
Because the ampersand character (&) is disallowed, it is not possible to create an ordinary link containing &action=edit or &redirect=no in the URL query string. These kinds of links can be helpful in user pages. Also, a redirect page can have categories and you might wish to view or edit these in a single click.

The following syntax shows the use of the fullurl as it would appear in a template constructed to append action=edit to the URL query string:

[ }]
     

Note that this will render as an external link rather than as an internal link and for this reason it might not appear in what-links-here queries associated with the target page.


Links to and from a page
To list pages which link to the current page (backlinks), use the feature. The tag can be placed on pages with no incoming links.

To make the current page show up at "What links here" for a certain other page without creating a working link to that other page, use a link with a space following the pipe, as in [[commons:Boston, Massachusetts|]].

To list all pages which are linked from a particular page, enter the following URL, using the page title (with spaces replaced by underscores) in place of PAGENAME:

http://en.wikipedia.org/w/api.php?action=query&prop=links&pllimit=500&titles=PAGENAME
The number of links returned is limited to 500.


Additional link-related functions
For the effect that links have on date formatting, see .

Another link-dependent feature is , which makes it possible to view recent changes to all pages which are linked from the current page (or which are members of the category, if it is a category page).

For information on how to link to pages from an image, see .

Several templates have been created to make linking easier (although they are not usually used in article space). These include and for linking to templates, and and for linking to categories. More can be found in .


Conversion to [[canonical form/" itemprop="url" title="Wiki: "> <hr class="us2411627114"> <span class="us896110720 us1353177739">Conversion to [[canonical form">">
Conversion to [[canonical form
As described above, if a link target begins with a lower case letter, it will be interpreted as if it began with the equivalent capital letter. If the target contains a prefix, then the whole prefix and the first character after the colon are case-insensitive (so links to ).

In link targets, spaces and underscores (which are effectively equivalent) are ignored if they come at the start, at the end, or immediately before or after the colon following a namespace prefix. Consecutive spaces/underscores are treated as a single space. Hence links to .

Also, and characters are replaced with their raw character. For example, [[commons:Boston, Massachusetts|Boston]] produces , and [[w:{{{1}}}|]] produces . Links which resolve to are displayed as unmarked-up wikitext.

Titles indicated by wikilinks are displayed in canonical form (with correction of capitalization and excess spaces/underscores removed, as described above) in the following places:

  • in tags for non-existent pages: [[w:{{{1}}}|{{{1}}}]] gives ;
  • in pop-ups and on the status bar (if applicable for the browser) when the mouse cursor is moved over the link;
  • on pages;
  • in the box.

The prefixes in are treated similarly to namespace prefixes: they are insensitive to case and to spaces before and after the colon. However the first character after the colon is not automatically capitalized (whether it is interpreted as a capital depends on the configuration of the target wiki).


See also

Account

Social:
Pages:  ..   .. 
Items:  .. 

Navigation

General: Atom Feed Atom Feed  .. 
Help:  ..   .. 
Category:  ..   .. 
Media:  ..   .. 
Posts:  ..   ..   .. 

Statistics

Page:  .. 
Summary:  .. 
1 Tags
10/10 Page Rank
3115 Page Refs
1s Time