Page semi-protected

Help:What links here

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search

Within the Toolbox section on the left-hand side of every page is a link labeled "What links here". This is used to see a list of the pages that link to (or redirect to, or transclude) the current page. These are sometimes referred to as backlinks.

It is possible to make a wikilink to the "What links here" list for a particular page; to do this type [[Special:WhatLinksHere/Page name]], replacing Page name with the title of the target page. (The same text – without the brackets – can also be entered in the search box, to access "What links here" for any page title.)

It is also possible to list the pages with {{Special:Whatlinkshere/Page name|namespace=number}}, where Page name is the name of the page, and namespace (optional) is the number of the namespace. E.g. {{Special:Whatlinkshere/Help:What links here|namespace=0}} lists all pages from article space that link to this page.

To use the tool, click Special:WhatLinksHere and type in the page title.

"What links here" is limited to showing actual backlinks. Pages which contain the title being searched for, but where the title has not been linked, are excluded from the results. An alternative script exists to search out such pages, where possible unlinked backlinks may exist for the respective article.

Overview

The "What links here" facility lists the pages on the same site (English Wikipedia) which link to (or redirect to, or transclude) a given page. It is possible to limit the search to pages in a specified namespace. To see this information, click the "What links here" link while looking at any page. The list is sorted by page ID, i.e., by date of creation of the page.

This information comes from the pagelinks table and the templatelinks table. Pages redirected to the given page are marked "redirect". Pages transcluding the given page are marked "transclusion"; for these pages it is not shown whether they also link to the given page. For image and other file pages, the pages using the image or file appear on the list and are marked "image link".

The parser function #ifexist: causes a listing in "What links here" among the normal links even though no link is produced.

The list of links to an article is useful in a number of ways:

  • The number of incoming links gives a rough indication of how important or popular a page is.
  • Where the intended subject material of an article is unclear, the list of articles linking to it might provide useful context.
  • It facilitates proper disambiguation.

The function works even for a page title that does not exist (recording redlinks to that title). The "What links here" link appears on the edit page on which one arrives when following a broken link. Thus, for example, if film articles are linked to the actors, one can find the films an actor has played in even if there is no article about the actor.

To invoke a "What links here" list directly (in the search box, browser address bar, or wikilinks) use the syntax Special:WhatLinksHere/John Smith (replacing "John Smith" with the desired target article title).

Limitations

The following are not listed at "What links here":

In the case of links to sections or other anchors, the precise target is not shown. "What links here" cannot list the backlinks of a specific section/anchor only. (It may be possible to work round this by making a new title that redirects to a particular section, and encouraging people to make links to the redirect rather than the section. Another possibility is to use Linksearch, but here users would have to add hidden external links.)

As mentioned, backlinks which have not yet been linked are excluded from the results. An alternative script exists to search out such pages.

Also note that if a page's links change because of a change in a template, the backlinks for that page are not updated immediately, but via the job queue.

Redirects

The What links here report will list a redirect to a page, and indented under it any incoming links to the page that go through that redirect.

For a double redirect, the indent is double, and any incoming wikilinks to the page that go through the two intervening redirects are then shown triple indented. Although they are shown, double redirects are cleaned up; any triple redirects will become doubles, so triple redirects are not shown, just doubles.

For a demonstration, see the What links here report for this page. Double redirects and redirects to sections are set up at /demo rdcheck.

Only show incoming redirects

To only show incoming links, click on "What links here" and then click both "Hide transclusions" and "Hide links".

To hide incoming redirects, click on "Hide redirects".

Transclusions

The backlinks list includes transclusions of the current page.

It also includes links which exist on certain pages because the page transcludes another page (template). For example, if page A transcludes template B, and B contains a link to C (not contained within <noinclude> tags), then the link to C will appear on page A, and A will be listed among the backlinks of C.

It is possible that a page contains a link to C because it transcludes a template even though the template does not itself contain such a link (the link may be produced in the template wikitext by the application of various parser functions, rather than explicitly). In this case the template will not show up in the backlinks of C, although pages on which it is transcluded will (if they have the links to C). It may be convenient to make the template appear on the list by placing a link to C on the template, within <noinclude> tags.

Number of links

The "What links here" page does not display how many backlinks exist in total. The number of links displayed at one time is limited – initially to 50, although there are links to change this to certain other values. (Different values can be obtained by editing the URL resulting from clicking these links, but the maximum possible value is 5,000.)

Extensions and programming

Number of Backlinks

The "What links here" page body has selector body.page-Special_Whatlinkshere, so for example we can use the CSS body.page-Special_Whatlinkshere ul { list-style: decimal } to number the backlinks.

It is possible to obtain the list of backlinks (with additional information) programmatically using the MediaWiki API. For information on how to do this, see the API documentation.

Semantic Relations

With the extension Semantic MediaWiki (SMW) links are categorized by specifying relations. For a given relation the backlinks of a page can be produced in-page. A series of queries, one for each relation (which seems cumbersome but can be put in a template like [1]), provides an in-page list of backlinks sorted by relation. Moreover, forward links and attributes of the resulting pages can also be provided, and also backlinks of backlinks.

DPL method

A simpler extension that can embed backlinks (without the semantic functionality) is Dynamic Page List. EXAMPLE NEEDED

Suppress links

"(← links | edit)" can be suppressed by placing the following in Common.css

.mw-whatlinkshere-tools{
    display:none;
}

However, "(transclusion)" can't be suppressed with that CSS. Maybe with CSS# positional-selection.

Unclear Warning

It is not possible to simply transclude a "Special:WhatLinksHere/Page_name" page, as only a certain sub-group of Special Pages can be transcluded: Wikipedia:Transclusion#Special pages.

Workaround to hide transcluded links

It is a known limitation that there is no way to filter out pages that link to the current page via a transcluded template. This limits the usefulness of "What links here" in cases where a page is linked to from a widely transcluded navbox. A workaround is to perform a search using the insource parameter, e.g. use insource:/"[[Foo]]"/ to search for articles that contain direct links to Foo, and insource:/"[[Foo|"/ for articles that contain piped links. A user script, User:PrimeHunter/Source links.js, simplifies this process by providing a link to automatically perform the search.

Examples

See also
https://en.wikipedia.org/wiki/Help:What_links_here?rdfrom=https%3A%2F%2Finformatiestandaarden.nictiz.nl%2Findex.php%3Ftitle%3DHelp%3AWhat_links_here%26redirect%3Dno
en.wikipedia.org
crawl=CC-MAIN-2020-50
93179
application/http; msgtype=response
sha1:WMY75YR6GITVWNX3AOMNOXNPXV7GL4GT
<urn:uuid:00895907-382f-4e7a-96a8-a924f2ce8580>
2020-12-02T09:48:38Z
208.80.154.224
text/html
sha1:XDQDTGENDVDKOIFJ2TV4MGZSRHVGU4BF
<urn:uuid:d3972cae-b1e4-423d-8505-8be05b3b7618>
https://en.wikipedia.org/wiki/Help:What_links_here?rdfrom=https%3A%2F%2Finformatiestandaarden.nictiz.nl%2Findex.php%3Ftitle%3DHelp%3AWhat_links_here%26redirect%3Dno
response
<urn:uuid:98a397fb-5e9d-4508-b791-8949e92e0767>
isPartOf: CC-MAIN-2020-50
publisher: Common Crawl
description: Wide crawl of the web for November/December 2020
operator: Common Crawl Admin (info@commoncrawl.org)
hostname: ip-10-67-67-29.ec2.internal
software: Apache Nutch 1.17 (modified, https://github.com/commoncrawl/nutch/)
robots: checked via crawler-commons 1.2-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)
format: WARC File Format 1.1
conformsTo: http://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/