Internal links

Offline MediaWiki Code Editor

Internal Links
Previous Top Next

For external links see: External links
graphic
An assistant to convert a selected text to an internal link.
All wikitext markup languages have a simple way of hyperlinking to other pages within the site, but there are several different syntax conventions for these links. Many wikis, especially the earlier ones, used CamelCase to mark words that should be automatically linked. In MediaWiki, this convention was replaced with the [[…]] notation, which Wikipedia calls "free links".
In Wikipedia and some other wikis, free links are used in wikitext markup to produce internal links between pages, as opposed to the concept of CamelCase for the same purpose, which was used in the early days of Wikipedia.

In Wikipedia's markup language, you create free links by putting double square brackets around text designating the title of the page you want to link to. Thus, [[Texas]] will be rendered as Texas. Optionally, you can use a vertical bar (|) to customize the link title. For example, typing [[Texas|Lone Star State]] will produce Lone Star State, a link that is displayed as "Lone Star State" but in fact links to Texas.

Link to other wiki article

·    Internally, the first letter of the target page is automatically capitalized and spaces are represented as underscores (typing an underscore in the link has the same effect as typing a space, but is not recommended).

·    Thus the link hereafter is to the Web address en.wikipedia.org/wiki/Public_transport, which is the Wikipedia article with the name "Public transport". See also Canonicalization.

·    A red link is a page that doesn't exist yet; it can be created by clicking on the link.

·    A link to its own page will appear only as bold text.


London has [[public transport]].

    Renders as:

London has public transport.

Renamed link

·    Same target, different name.

·    The target ("piped") text must be placed first, then the text to be displayed second.
New York also has [[public transport|public transportation]].

    Renders as
New York also has public transportation.

Automatically rename links

Simply typing the pipe character | after a link will automatically rename the link in certain circumstances. The next time you open the edit box you will see the expanded piped link. When previewing your edits, you will not see the expanded form until you press Save and Edit again. The same applies to links to sections within the same page.

·    Automatically hide stuff in parentheses:
[[kingdom (biology)|]]  >>>   kingdom

·    Automatically hide the comma and following text
[[Seattle, Washington|]]  >>>   Seattle

·    Automatically hide namespace

[[Wikipedia:Village pump|]] >>>  Village pump

Or both
[[Wikipedia:Manual of Style (headings)|]]  >>>  Manual of Style

But this doesn't work for section links
[[Wikipedia:Manual of Style#Links|]]   [[Wikipedia:Manual of Style#Links|]]

Blend link

·    Endings are blended into the link.


·    Exception: a trailing apostrophe (') and any characters following the apostrophe are not blended.

·    Preferred style is to use this instead of a piped link, if possible.

·    Blending can be suppressed by using the <nowiki /> tag, which may be desirable in some instances.

Blending active

San Francisco also has [[public transport]]ation. Examples include [[bus]]es, [[taxicab]]s, and [[tram]]s. 

San Francisco also has public transportation. Examples include buses, taxicabs, and trams.

Blending suppressed

A [[micro-]]<nowiki />second.  >>>  A micro-second

Link to a section of a page

·    The part after the hash sign (#) must match a section heading on the page. Matches must be exact in terms of spelling, case, and punctuation. Links to non- existent sections are not broken; they are treated as links to the beginning of the page.

·    Include "| link title" to create a stylish (piped) link title.

·    If sections have the same title, add a number to link to any but the first. #Example section 3 goes to the third section named "Example section". You can use the pipe and retype the section title to display the text without the # symbol.


Example #1

[[Wikipedia:Manual of Style#Italics]] is a link to a section within another page.

Wikipedia:Manual of Style#Italics is a link to a section within another page.


Example #2


[[#Links and URLs]] is a link to another section on the current page. [[#Links and URLs|Links and URLs]] is a link to the same section without showing the # symbol.

#Links and URLs is a link to another section on the current page. Links and URLs is a link to the same section without showing the # symbol.


Example #3

[[Wikipedia:Manual of Style#Italics|Italics]] is a piped link to a section within another page.

Italics is a piped link to a section within another page.

Interwiki link

Interwiki links are links to any page on other wikis. Interwikimedia links link to other Wikimedia wikis. Note that interwikimedia links use the internal link style, with double square brackets.

By adding a prefix to another project, internal link style ("prefixed internal link style") can be used to link to a page of another project. A system of short-handed link labels is used to refer to different projects, in the context of interproject linking, as seen within the actual source text. Most common wikiprojects:

Project
Long form
shortcut
Wikipedia
Wiktionary
Wikinews
Wikibooks
Wikiquote
Wikisource
Wikispecies
Wikiversity
Wikivoyage
Wikidata
[[wikipedia:]]
[[wiktionary:]]
[[wikinews:]]
[[wikibooks:]]
[[wikiquote:]]
[[wikisource:]]
[[wikispecies:]]
[[wikiversity:]]
[[wikivoyage:]]
[[wikidata:]]
[[w:]]
[[wikt:]]
[[n:]]
[[b:]]
[[q:]]
[[s:]]
[[species:]]
[[v:]]
[[voy:]]
[[d:]]
Example

For example, to link from here to the "surfeit" article on Wiktionary, you would include the wikilink [[wikt:surfeit]] It would appear as follows: wikt:surfeit.

The long form doesn't work within the same project. The shortcut works everywhere. (That is the intention; currently, it does not work on all projects.)

The interwiki map on Meta lists many prefixes, among others, [[wikipedia:]] ([[wikipedia:]]) for the English Wikipedia, working from any wiki supporting the Meta interwiki map, not only from MediaWiki wikis. Some prefixes work only with a page, for example: wikipediawikipedia: (fails) vs. wikipediawikipedia:Interwikimedia link (works). These prefixes are case insensitive.

Non-Wikimedia interwiki codes have a limitation, that they can only be used through a link. For example, the entry for "John" on Wiktionary, a Wikimedia project, can be accessed by [[wikt:John]] or http://meta.wikimedia.org/wiki/wikt:John. However, the latter method does not work for non-Wikimedia wikis. For example, the main page on the Mozilla Wiki can be accessed via [[MozillaWiki:Main Page]], but http://meta.wikimedia.org/wiki/MozillaWiki:Main_Page results in an error. In these cases, Special:Search can be used (http://meta.wikimedia.org/wiki/Special:Search/MozillaWiki:Main_Page). You can see the Interwiki special page for a list of "forward" and "non-forward" prefixes.

In Interwiki linking, in the case of linking to another Wiki project, but in a different language, this may be done by first putting the project link target, then a colon followed by the target language as a prefix to the article page name, in the form:

[[projectname:languagecode:articlename]].

For example, to link from en.Wikipedia to a Chinese language text at Wikisource (zh.wikisource):

Type: [[wikisource:zh:天問]]                                   To get: wikisource:zh:天問

Type: [[wikisource:zh:天問|天問]]                            To get: 天問

Type: [[wikisource:zh:天問|Heavenly Questions]]     To get: Heavenly Questions

These 3 examples all resolve to the zh.wikisource page 天問, but without the misleading and distracting appearance of being an external link.

Interlanguage links

Interlanguage links are links from a page in one Wikipedia language to an equivalent page in another language. These links can appear in two places:

·    In the "Languages" list – a sidebar that appears on the left side (default position) of the current page.

·    Inline, in the text of a page ("local" links).

These two types of links are created and handled differently.

As of February 2013, the use of "local" links for interlanguage linking has been deprecated, with interlanguage link data being centralized on Wikidata, a structured knowledge base project. Pages with their interlanguage links on Wikidata display an "Edit links" button under the language list.

Wikidata

Wikidata is a separate project to create a collaboratively edited knowledge base. Part of this project is to centralize the interlanguage links for all the Wikipedia projects. The Wikidata entry for a page contains (among other things) a list of links for that entry in different languages. This list of links is then used for the list shown on the page in Wikipedia.

At the bottom of the Wikidata language list is a link labelled 'Edit links'. Clicking on this will reveal two text boxes, one for the language and another for the article title. In the first box type in the language code, for example, for Irish use the code "ga". In the second box, type the name of the article as it appears in that language's Wikipedia. Then click save. You can get directly to the Wikidata entry for a page by clicking the link labelled 'Data item' in the Toolbox section of the sidebar. The link does not appear on pages that haven't been linked to an item.
To edit an entry on Wikidata, click on the edit link next to the entry you wish to edit. A textbox will appear allowing you to edit the entry. Click on save when you are done.
You can remove a page from the list of Wikidata's links. To do so click edit, then click on the remove link.

When not to use Wikidata

If the scope of the two items is not in fact the same (typically, the article in one language is wider in scope than the article in the other language) and then they should not be linked. Unfortunately, there is no mechanism in Wikidata at present for linking articles that are related, but different in scope; it is possible to do it with local links.

Local links

Before Wikidata, interlanguage links had to be recorded in the text of the page itself. The problem with this approach was that each language had to maintain its own separate lists. So for example, if the name of a page on the English Wikipedia changed, then each language that linked to that page would have to separately notice this fact and then change their own links.

For most pages, these links are no longer needed and can be safely removed, but you should verify that the local list and the Wikidata lists match before doing so. There is an automated tool to help with that.

The local links do however still serve some purposes:

·    They override the information that comes from Wikidata.

·    They are required if more than one article (or redirect) in one language should point to a target article in another language.

·    They are required in order to explicitly link to or from redirects. This can be used to level semantical or organizational differences between articles in different Wikipedias so that the links can go to the exact equivalent term in another language rather than to an article with a somewhat different scope or only related topic.

·    They are required in order to link to sections of articles. For example, corresponding to the English article Spot welding, in Italian there is only a section rather than a full article, so Spot welding includes the local link [[it:Saldatura#Saldatura a punti]].

·    They are required for pages that are not allowed on Wikidata, such as your userpage.

Syntax

The local interlanguage links take the following form:

[[language code:Title]]

where the language code is the two-letter code as per ISO 639-1.

It is recommended interlanguage links be placed at the very end of the article.
Interlanguage links are not visible within the formatted article, but instead appear as language links on the sidebar (to the left) under the menu section "languages".


Example:

Link from English article "Plankton" to the Spanish article "Plancton":   [[es:Plancton]]

NOTE: These links are treated specially, and don't show up in the body of the text, but in a special sidebar section "Languages" listed by language name. They can go anywhere in the article source as their placement does not alter the visual appearance of the links on the rendered page except for the order. However, the convention is to put them at the bottom of the page. Remember, you only need these type links if you are overriding the information from Wikidata, otherwise you should edit the links on the Wikidata entry.