Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Help:Link
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Link reports == {{more|Help:What links here}} The navigable links to a page are wikilinks, redirects, and external-styled wikilinks. The {{tl|orphan}} tag can be placed on pages with no incoming wikilinks. === To a page === Each link to a page is a link to a ''name''.<ref> The aliases for the namespace part of the name are recognized in wikilinks and in the parser functions that create URL style links β canonicalurl and fullurl. They are also recognized in the navigation box, and in Search, except for the ''insource'' parameter. </ref> No one report shows all links to the ''content''. The [[Help:What links here|What links here]] tool, on every page, will report all wikilinks and all redirects to the ''content'' of that page. (You get the wikilinks to the redirects too.) The [[H:S|search]] parameter '''linksto''' will find wikilinks only. Both report (invisible) wikilinks placed by a transclusion through a {<nowiki/>{[[help:template|template]]}}. The difference between them is that ''linksto'' reports a count of links to ''a page name'', while ''WhatLinksHere'' reports a map of links to ''the page as content''.<ref> "What Links Here" does not report URL-style links to a page.</ref> === To a section === The navigable links to a section of a page are wikilinks, redirects, and URL-styled wikilinks. The difference between a redirect and a wikilink is most pronounced where a redirect targets a section, when you cannot add your own <kbd>#''section''</kbd>{{space}} to it even though it appears as <code>[<nowiki/>[''page name'']]</code>. A wikilink that links to a section ''and'' that appears as <code>[<nowiki/>[''page name''#''section name'']]</code> can link to that section through the canonical page name (the title on the page with the actual content) or through the page name of any redirect to it, in which case the page name is the name of a redirect page. To find wikilinks to a section requires two or more reports. # '''Show redirects only''', an external tool available from the '''What links here''' page, reports redirects to the ''content'' of a section. (No matter which page ''name'' you give it, you get all the redirect page names.) Look past any "'''''No anchor or section'''''" group of redirects, and any "invalid" sections, to see if your particular section name is explicitly listed, because then the redirect pages under it can have incoming links that will then go to that section.<ref> Redirects that link to a section are part of a valiant effort to enable changing a section heading without breaking a link to the ''name''. That effort also must ask editors who want to link to a section to always check the wikitext of the target section, and there find, read and understand the plan to link to a single redirect page instead. Then that redirect page links to the section. ("Invalid" redirects to a non-existing anchor or section occur when this is overlooked.) </ref> ("What Links Here" also has a "show redirects" report, but it doesn't specify if the redirect goes to any particular section.) # Use "What Links Here" on any redirect pages found in the previous step. # Use {{tl|Links to}} to create a group of search links that will each report some links to a section. It can work with only one page name at a time. For each search link given, just change the page name in the query to each redirect in turn. The more redirects there are, the more reports there are to run. If there are no redirects involved, one report from "Links to" is enough. === From a page === To report links ''from'' a page, you simply list all the wikilinks on that page. * {{slink|Wikipedia:Tools/Editing tools|Relink}} can count wikilinks from a copy of the wikitext on your local machine. * Some [[Wikipedia:text editor support|text editors support]] the counting and highlighting of the <code>[<nowiki/>[...]]</code> pattern occurrences. * The Wikipedia [[Application programming interface#Web APIs|web API]] accepts queries by URL.<ref> If you will use the API heavily or professionally you should follow its currently listed recommendations at [[mw:API:Query|API]]. (Use <kbd>continue=</kbd>, use <kbd>formatversion2</kbd>, use multiple pages at once, etc.)</ref> One way to send a query to the API is by creating an external link ({{slink||External links}}). For example, using an external link very much like a search link, you can send the API a request to list the link properties of "[[wp:example]]". It should interpret it correctly as "Wikipedia:Example", ''pageid 25263910''. ; What you type :<kbd>[/<nowiki/>/en.wikipedia.org/w/api.php?action=query&prop=links&pllimit=500&titles=''fullpagename'' ''your label'']</kbd> ; What you get when fullpagename is [[wp:example]] :[//en.wikipedia.org/w/api.php?action=query&prop=links&pllimit=500&titles=wp:example ''your label''] * The report is in [[JSON]] format, as is usual for RESTful APIs. * The pageid is available from '''Page information''' on every page. * The <kbd>titles</kbd> parameter is plural. (It is designed to take multiple fullpagenames or pageid, delimited by the | pipe character.) * The number of links returned by this query is limited to 500, per the URL you created. See [[mw:API:Query]] for how to safely get more. For example, [[Operating system]] has 510 wikilinks. To make a page register as a link to a page, but without actually showing the link, make a link to it, but label it with a space character using the pipe trick: <kbd>[<nowiki/>[''pagename''| ]]</kbd>.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)