Community Wishlist Survey 2022/Miscellaneous/Include section links in WhatLinksHere

Include section links in WhatLinksHere

  • Problem: When section names are updated in an article, it's difficult to find which articles link there, making it much more difficult to update broken section links.
  • Proposed solution: When caching Special:WhatLinksHere, add which section (if any) they link to. It would also then be possible to automatically generate a list of articles with links to sections that no longer exist.
  • Who would benefit: Editors trying to find broken section links, and so readers who will be redirected to broken sections links less frequently.
  • More comments:
  • Phabricator tickets: phab:T18561
  • Proposer: --YodinT 19:49, 18 January 2022 (UTC)

Discussion

I usually use insource: search for this task. It lets me find any specific string of interest in the wiki-source. DMacks (talk) 09:51, 19 January 2022 (UTC)
That works, but only if you know previous section names. I guess there are many thousand links to non existant sections in articles that aren't being watched by an editor. This would let a new editor find all of these with one click (otherwise they would have to go through the page history to find all previous section names, and this wouldn't catch any section name typos in links either). It could also easily compile a list of all the broken sections links that are in the mainspace, in case any editors wanted to work through and fix some of them. --YodinT 11:18, 19 January 2022 (UTC)
I mis-read the proposal as targetted at the editor who is changing the section-name (to fix the inbound links themself at that time) rather than to catch broken links afterwards. I agree that some tools for finding and fixing inbound links to sections that don't exist would be useful. I think enwiki has some tool or bot, will look... DMacks (talk) 11:26, 19 January 2022 (UTC)
  • I support this, although I think it might be even better if section links were given a section of their own in the list.--YTRK (talk) 12:12, 22 January 2022 (UTC)
    • Having this, or some way to sort by section/anchor link would definitely help. --YodinT 20:55, 28 January 2022 (UTC)
  • Ideally this solution would extend to {{anchor}}s, not just section links. Danbloch (talk) 19:42, 28 January 2022 (UTC)
    • Completely agree. --YodinT 20:55, 28 January 2022 (UTC)
    They (as well as anchors that do not actually exist in the article) are handled/displayed the same by WhatLinksHere anyway, so I doubt there would be a problem with that. ~~~~
    User:1234qwer1234qwer4 (talk)
    21:42, 8 February 2022 (UTC)
  • I don't know if this holds true for all Wikipedias, but at least in the English Wikipedia, WhatLinksHere shows the target anchor/section of redirects in the list as
<page name> (redirect to section "<anchor>")
since perhaps two or three years ago.
However it does this only for redirects. I guess this is down to the fact that there can be only one such link in a redirect, but there could be many links pointing to the same page in an article and they do not necessarily all point to the same target anchor/section. Also, parsing a redirect for such target anchors is quickly done, but searching a whole article for them is an expensive operation (when done on demand and without caching). If there are multiple links from a page to the target page, but to different anchors in that page, WhatLinksHere could (group and) list them in separate lines like:
<page name> (link to section "<anchor>")
Since this is an expensive operation I think there should be a selection box in the header of WhatLinksHere to activate the feature only when it's actually needed.
It would also be great, if WhatLinksHere would actually check if a target anchor/section name exists on the target page, and display modified messages instead:
<page name> (redirect to non-existing section "<anchor>")
<page name> (link to non-existing section "<anchor>")
Given, that parsing the target article is an expensive operation as well, there should be a check box to enable this feature on demand only.
If the target article gets parsed for the anchors/section names already, the messages could actually distinguish between anchors and section names in the resulting messages like:
<page name> (redirect to section "<anchor>")
<page name> (link to section "<anchor>")
<page name> (redirect to anchor "<anchor>")
<page name> (link to anchor "<anchor>")
<page name> (redirect to non-existing section/anchor "<anchor>")
<page name> (link to non-existing section/anchor "<anchor>")
And finally a remark: Fixing broken anchor names is fine by either editing the source or the target, but it should be communicated to over-ambitious editors that blindly removing them is not. A link to a non-existing anchor does no "harm" by itself, it is perfectly valid HTML etc., the browser will just set the focus to the top of the page. There are often groups of links from articles and redirects pointing to the same anchor in a target article, and even if it does not exists, it still carries useful semantic information on which specific content is missing in an article, which of the incoming redirects are synonyms or at least semantically closely related, and which source links need to be updated in other articles and redirects when the missing contents get added/moved somewhere. This semantic infrastructure info is useful for article maintenance and reverse lookup, and by blindly deleting dangling anchor fragments, this information would get lost.
Thinking about it, it might even be useful to have an option in WhatLinksHere to sort the resulting list entries by anchor names (regardless if they exist in the target page or not), so that incoming links pointing to the same anchor can be grouped.
--Matthiaspaul (talk) 21:28, 29 January 2022 (UTC)
What would be the technical/syntactical difference between a non-existent section and a non-existent anchor? ~~~~
User:1234qwer1234qwer4 (talk)
21:43, 8 February 2022 (UTC)
Sorry for the late reply, seeing this only now... That's a good point, as they are non-existing, they can't be distinguished. I have updated the suggested list above accordingly.
--Matthiaspaul (talk) 02:53, 28 February 2022 (UTC)
  • I agree with your points about redirects, and links to more than one anchor/section from one page. Grouping by anchor names would tie well into the suggestion by YTRK above. --YodinT 00:42, 11 February 2022 (UTC)
  • Let me point you to a discussion in German Wikivoyage where we discussed broken links to anchors. In de-wv we're using excessively a template that as a side effect creates an anchor for the item. The known problems for sections apply here too. A fix would be a big help for the project. --4omni (talk) 13:24, 30 January 2022 (UTC)
    • Good example! Even if this proposal doesn't make it this year, I'm hoping that there's a chance that it (and sorting alphabetically, etc.) might be still included if WhatLinksHere is overhauled. --YodinT 00:42, 11 February 2022 (UTC)

Voting

  •   Support * Pppery * it has begun 18:43, 28 January 2022 (UTC)
  •   Support Danbloch (talk) 19:43, 28 January 2022 (UTC)
  •   Support for anchors, not only sections --Andyrom75 (talk) 20:19, 28 January 2022 (UTC)
  •   Support — Draceane talkcontrib. 21:38, 28 January 2022 (UTC)
  •   Support Izno (talk) 23:27, 28 January 2022 (UTC)
  •   Support Broken section links are absolutely a problem, since bots fixing them haven't always been operational. This would help. {{u|Sdkb}}talk 00:23, 29 January 2022 (UTC)
  •   Support Dexxor (talk) 12:47, 29 January 2022 (UTC)
  •   Support Aca (talk) 13:38, 29 January 2022 (UTC)
  •   SupportBruce1eetalk 14:13, 29 January 2022 (UTC)
  •   Support Good idea. — Jules* Talk 18:29, 29 January 2022 (UTC)
  •   Support With all the related extensions proposed in the discussion above. --Matthiaspaul (talk) 21:29, 29 January 2022 (UTC)
  •   Support Including anchors/fragments, not just sections. Nw520 (talk) 23:44, 29 January 2022 (UTC)
  •   Support czar 23:54, 29 January 2022 (UTC)
  •   Support SD0001 (talk) 03:47, 30 January 2022 (UTC)
  •   Support YTRK (talk) 07:46, 30 January 2022 (UTC)
  •   Support --4omni (talk) 13:24, 30 January 2022 (UTC)
  •   Support Wotheina (talk) 15:40, 30 January 2022 (UTC)
  •   Support DerFussi 15:44, 30 January 2022 (UTC)
  •   Support Libcub (talk) 22:10, 30 January 2022 (UTC)
  •   Support JPxG (talk) 00:46, 31 January 2022 (UTC)
  •   Support It's good for archiving talk pages, as we can link section links (however, we can't do that in edit summaries) Thingofme (talk) 01:48, 31 January 2022 (UTC)
  •   Support Dreamy Jazz talk to me | enwiki 14:42, 31 January 2022 (UTC)
  •   Support Havang(nl) (talk) 16:11, 31 January 2022 (UTC)
  •   Support JAn Dudík (talk) 20:44, 31 January 2022 (UTC)
  •   Support Trey314159 (talk) 22:50, 31 January 2022 (UTC)
  •   Support -- Ahecht (TALK
    PAGE
    ) 21:36, 1 February 2022 (UTC)
  •   Support Daniel Case (talk) 22:42, 1 February 2022 (UTC)
  •   Support ~ Amory (utc) 20:47, 2 February 2022 (UTC)
  •   Support Uanfala (talk) 21:53, 2 February 2022 (UTC)
  •   Support YBG (talk) 07:17, 3 February 2022 (UTC)
  •   Support WikiAviator (talk) 15:44, 3 February 2022 (UTC)
  •   Support - Darwin Ahoy! 19:22, 4 February 2022 (UTC)
  •   Support —— Eric LiuTalk 05:49, 5 February 2022 (UTC)
  •   SupportKPFC💬 11:35, 5 February 2022 (UTC)
  •   Support Ealdgyth (talk) 17:27, 5 February 2022 (UTC)
  •   SupportThanks for the fish! talkcontrib (he/him) 21:39, 5 February 2022 (UTC)
  •   Support Waldyrious (talk) 00:10, 6 February 2022 (UTC)
  •   Support--Vulp❯❯❯here! 04:34, 6 February 2022 (UTC)
  •   Support Ayumu Ozaki (talk) 07:15, 6 February 2022 (UTC)
  •   Support Emaus (talk) 08:27, 6 February 2022 (UTC)
  •   Support Voice of Clam (talk) 10:40, 6 February 2022 (UTC)
  •   Support C933103 (talk) 15:10, 6 February 2022 (UTC)
  •   SupportDaxServer (t · c) 21:35, 6 February 2022 (UTC)
  •   Support --Achim55 (talk) 09:02, 8 February 2022 (UTC)
  •   Support ~~~~
    User:1234qwer1234qwer4 (talk)
    21:40, 8 February 2022 (UTC)
  •   Support Rots61 (talk) 22:08, 8 February 2022 (UTC)
  •   Support Gaurav (talk) 06:38, 11 February 2022 (UTC)