MediaWiki talk:Linkshere

Protected edit request on 22 September 2020
Show the "Transclusion count" link for subpages of User:UBX (which are de facto templates - userboxes).

Updated code is in User:ProcrastinatingReader/sandbox3. I can't test it, so can't be sure it works. Basically just adds: | explanation: adds userspace 2 to accepted list if the rootpagename is UBX, otherwise uses '999' as a random invalid namespace (not 100% sure that part is required, verses an empty string). ProcrastinatingReader (talk) 01:42, 22 September 2020 (UTC)
 * I think I'd prefer to just rip out all of that logic and show the transclusion count for all pages, since anything can be transcluded. Any objections to that? Jackmcbarn (talk) 21:13, 24 September 2020 (UTC)
 * That seems fine to me. Seen a few cases where even articles are transcluded (eg 2020–21 Premier League), so seems reasonable. ProcrastinatingReader (talk) 12:45, 25 September 2020 (UTC)
 * Yes check.svg Done Jackmcbarn (talk) 13:39, 25 September 2020 (UTC)
 * Thanks Jack! ProcrastinatingReader (talk) 13:53, 25 September 2020 (UTC)

Protected edit request on 9 October 2020
The "Show redirects only" link was removed this summer since the tool had stopped functioning. It turns out that it's still possible to only show redirects, but that it is so non-obvious that no normal user could be expected to figure it out.

I want to suggest that we implement Ahecht's proposed solution from a few years back and add the button in again on the form:

[ Show redirects only] – Thjarkur (talk) 20:24, 9 October 2020 (UTC)
 * I disagree that it's "so non-obvious that no normal user could be expected to figure it out", so this seems redundant to me, but I'll leave this active in case another admin has a different opinion. Jackmcbarn (talk) 20:30, 9 October 2020 (UTC)
 * What precipitated this request was this discussion at the Help Desk, both me and DuncanHill have spent a few months now without having been able to figure this out on our own. "Hide links" does not do what I assumed it would, since redirects "link" to pages. – Thjarkur (talk) 20:38, 9 October 2020 (UTC)
 * Although, as a non-admin, my opinion is apparently not worth considering according to Jackmcbarn above, I strongly support this as the workaround is profoundly non-obvious. Perhaps I'm abnormal. DuncanHill (talk) 20:39, 9 October 2020 (UTC)
 * I think Jackmcbarn was referring to "if another admin sees this and decides to implement this" – Thjarkur (talk) 21:00, 9 October 2020 (UTC)
 * What Þjarkur said. I definitely didn't mean that non-admins' opinions aren't worth considering. Jackmcbarn (talk) 21:30, 9 October 2020 (UTC)
 * I am glad to hear it, thank you. DuncanHill (talk) 01:58, 10 October 2020 (UTC)
 * Where do you want it? Before or after the "external tool"? &mdash; Martin (MSGJ · talk) 22:36, 10 October 2020 (UTC)
 * I haven't got "external tool" on what links here. It could go after the filters. DuncanHill (talk) 00:11, 13 October 2020 (UTC)
 * I agree with Jackmcbarn that this link is redundant and should not be added. * Pppery * it has begun... 20:03, 11 October 2020 (UTC)
 * ❌ more discussion needed to form a consensus first; as the functionality is already present on the page there isn't an urgent need to do this from a technical level either. Feel free to reactivate the edit request if a consensus to change emerges. — xaosflux  Talk 01:44, 13 October 2020 (UTC)
 * 1) The functionality is well-hidden on the page. 2) Where are we meant to seek such a consensus? DuncanHill (talk) 01:46, 13 October 2020 (UTC)
 * right here is fine. As far as hidden, I don't use it much but did just take it for a ride and it was quite easy to use - went to an article, clicked on what links here, and saw all the links - the interface shows all the pages that transclude, link, or redirect to the page and gives you the option to not see any of those things.  In following the short discussion above it appears that some editors want to add a shortcut to the "not transclude AND and NOT link" results and call it "redirects only" - and some editors think that is unnecessary.  I would think the same argument could be made for other combinations (e.g. "transclusions only") and it would have the same opposition - basically that this isn't needed. On a related note, the top of WLH does link to Help:What links here already - and I think the directions call out exactly what you are looking for in Help:What_links_here ? —  xaosflux  Talk 10:42, 13 October 2020 (UTC)
 * So you're closing the discussion on this page because more discussion on this page is needed There is nothing on the what links here page at the moment to tell people how to see redirects only. There's an option to hide them, not an option to shew them. "hide links" implies that it hides links, not that it shews redirects! Nothing about "hide transclusions + hide links" implies in any way that the effect is to shew redirects. Redirects are links, so "hide links" ought to hide them as well! We shouldn't have to navigate away from the page in order to use it. Just because some people do not need something does not mean that nobody would have it.  DuncanHill (talk) 14:44, 13 October 2020 (UTC)
 * absolutely not! I've deactivated the immediate edit request that is prompting patrolling administrators to make an edit that is ready to go, but is otherwise being prevented by protection (in this case namespace protection).  Edit requests are an important check against protection restrictions.  As I noted above, the discussion should certainly continue. —  xaosflux  Talk 14:50, 13 October 2020 (UTC)
 * While the proposed link is mildly superfluous (should ideally be fixed by making a change to MediaWiki to have the filters work like the checkboxes like on Special:Contributions), we did have a link that did this up until recently. Another solution might be to change "Hide links" to "Hide links from pages". The interface is usable if you know what you're looking for (up until last week WP:WLH didn't mention this), but it is not 'discoverable' since the wording "Hide links" does not do what I assumed it did, and that when one sees "Hide redirects" one automatically tries to find an opposite of that ("Show redirects"), which is not available. – Thjarkur (talk) 23:44, 13 October 2020 (UTC)

Protected edit request on 8 March 2021
I created the tool https://linkcount.toolforge.org to get the number of wikilinks, redirects, transclusion, file links (if applicable), and category links (if applicable) for a page. The tool also covers the usage of https://templatecount.toolforge.org, so it makes sense to remove it. The tool should be added using the code: External tool: [//linkcount.toolforge.org/?project=en.wikipedia.org&page= Link count] – Brandon XLF  (talk) 23:10, 8 March 2021 (UTC) Code edited to include urlencode. – Brandon XLF  (talk) 14:04, 10 March 2021 (UTC)
 * any comments on this? — xaosflux  Talk 03:18, 9 March 2021 (UTC)
 * That closing curly bracket is a typo, right? Also, the link will probably fail when the page name includes a space, and, given the current code,  doesn't seem to include the namespace prefix. So it should probably be this way

External tool: [//linkcount.toolforge.org/?project=en.wikipedia.org&page= Link count]
 * though I might be still missing something. Nardog (talk) 04:48, 10 March 2021 (UTC)
 * Not sure how that bracket got in there. $1 is the full pagename, so it does include the namespace, but $2 is a wikilink, so it can't be used here. I edited my original code. – Brandon XLF  (talk) 14:03, 10 March 2021 (UTC)
 * Ah, I didn't see it was a link and  was stripping the prefix. Nardog (talk) 13:42, 12 March 2021 (UTC)


 * just make sure, is this what you ended up with:

External tool: [//linkcount.toolforge.org/?project=en.wikipedia.org&page= Link count]
 * ? —  xaosflux  Talk 02:24, 14 March 2021 (UTC)
 * , that is correct. – Brandon XLF  (talk) 02:54, 14 March 2021 (UTC)
 * ✅ — xaosflux  Talk 04:19, 14 March 2021 (UTC)

Post-revert discussion
I have undone this change, as I feel there should be some measure of discussion before making such a dramatic (and visually garish) change. Primefac (talk) 16:36, 19 March 2021 (UTC)
 * WP:BRD is fine of course, when you speak of the "dramatic" change, are you referring to the external content? The change in here on enwiki should have been extremely minor. —  xaosflux  Talk 17:03, 19 March 2021 (UTC)
 * Yes, I do realize the change here was relatively minor, and was referring to the result of that change. Primefac (talk) 17:05, 19 March 2021 (UTC)
 * Thanks, was making sure something didn't go crazy that I missed on our own interface! — xaosflux  Talk 17:08, 19 March 2021 (UTC)
 * What do you think was "visually garish"? This new link is many times better than the old and moreover clearly uses styling consistent to OOUI. --Izno (talk) 23:06, 19 March 2021 (UTC)
 * I suppose I should have said "visually jarring" instead of "garish", as I was expecting this with its nice background and relatively small text, and instead was hit with this, which contains huge boxes and twice as much information, some of which seems relatively useless to me unless I can see where those non-direct transclusions are coming from. Primefac (talk) 11:47, 21 March 2021 (UTC)
 * So, you had standard UX change whiplash. Got it. Izno (talk) 18:01, 21 March 2021 (UTC)
 * That's a good way to put it. As I alluded to earlier I'm okay with a consensus determining this is an okay change, but I want there to be a consensus (i.e. BRD at its finest). Primefac (talk) 18:13, 21 March 2021 (UTC)


 * BRD, you will need to advertise this and seek support now that it has been reverted. — xaosflux  Talk 17:16, 19 March 2021 (UTC)
 * @Xaosflux Where would you recommend I start a discussion? – Brandon XLF  (talk) 17:39, 19 March 2021 (UTC)
 * here is the right place, perhaps link in from WP:VPM to encourage some discussion participants. — xaosflux  Talk 17:40, 19 March 2021 (UTC)
 * Couldn't we at least have the link to BrandonXLF's tool in addition to the existing tool? FWIW I couldn't disagree more with Primefac. BrandonXLF's not only looks better but is far richer in functionality (and faster at least on my end). I just don't see how anyone would find it a dramatic change, let alone "visually garish". And even if they do, it doesn't hurt to have it in addition to, if not in place of, the old one. Nardog (talk) 18:26, 20 March 2021 (UTC)
 * we could sure; but I already made a change for this and it was reverted - and interface messages are not a good place to constantly make revisions, so lets see where this discussion goes (it certainly could result in "add both"). — xaosflux  Talk 19:43, 20 March 2021 (UTC)
 * Let's ask the reverter then. Would you object to adding the new tool in addition to the current one? Nardog (talk) 19:48, 20 March 2021 (UTC)
 * would object to both. The new one is clearly superior. :^) --Izno (talk) 20:19, 20 March 2021 (UTC)
 * I would too, but not as much as I would to the status quo. I'm only suggesting it as a tentative compromise until a larger consensus is reached. Nardog (talk) 20:22, 20 March 2021 (UTC)
 * How about a compromise to the compromise? Use both for maybe a month, and then revisit this discussion? As I mentioned above, I guess I don't really see the benefit to giving all of that extra information unless it can be used in some way (i.e. how are "direct transclusions" and "all transclusions" useful unless I can see the redirects or know how many there are?). I may be in the minority, sure, but I feel like a change like this should have at least some trial period before becoming the "one true way" to view this. Primefac (talk) 11:47, 21 March 2021 (UTC)
 * For the point about the transclusion count, the number of redirects to the page is already visible. I could also have, for example, the "Redirects" label link to, the "Direct transclusions" label link to , and the "All transclusions" link to . This would allow you to see what the count actually counting. I don't want to directly show the redirects as the tool is meant to complement WhatLinksHere and not replace it. – Brandon XLF  (talk) 21:13, 21 March 2021 (UTC)
 * Actually, that would be quite useful. I know it's not a replacement for the on-wiki tools, but "making life easier with fewer clicks" is always appreciated! Primefac (talk) 12:46, 22 March 2021 (UTC)
 * I think we ought to find a way to display those very useful metrics directly on the "what links here" page, without needing to send people to an external tool. Is that possible? &#123;{u&#124; Sdkb  }&#125;  talk 19:30, 19 March 2021 (UTC)
 * The short answer to that question is that I don't think that's technically feasible. Primefac (talk) 11:47, 21 March 2021 (UTC)
 * Not for us anyway. Probably feasible to do something like that on the PHP side. Izno (talk) 18:00, 21 March 2021 (UTC)
 * Probably using JavaScript, either globally in the site or using an approach like Get my IP address, calling an external tool to load the data and display it on the interface. But my "just do it with JavaScript" methods tend not to be very popular, so unlikely to happen. ProcrastinatingReader (talk) 20:13, 21 March 2021 (UTC)
 * I will admit I had the same experience as Primefac when I saw it (thinking "what just happened here?"). When I just want to see transclusion count I think I have a mild preference for the current page which just has less information. Surprising for me, actually, maybe I've spent so much time on this site I've gotten used to old school UIs... Anyway, that said, the new tool is functionally nice and it's actually maintained which means it might add more features (such as better template parameters? hint hint). A grey background would be nice for my eyes. Would have a preference for keeping both links up. ProcrastinatingReader (talk) 20:11, 21 March 2021 (UTC)
 * I added a grey background. – Brandon XLF  (talk) 21:24, 21 March 2021 (UTC)

Can we restore the link now? Perhaps like: External tools: Nardog (talk) 12:25, 25 March 2021 (UTC)
 * [//linkcount.toolforge.org/?project=en.wikipedia.org&page= Link count]
 * [//templatecount.toolforge.org/index.php?lang=en&namespace=&name= Transclusion count]
 * any objections to the "both" change for now - this can obviously always be revisited. — xaosflux  Talk 13:14, 25 March 2021 (UTC)
 * I'm fine with that. Primefac (talk) 13:23, 25 March 2021 (UTC)
 * , could you implement the change now? – Brandon XLF  (talk) 17:02, 31 March 2021 (UTC)
 * Yes check.svg Done Primefac (talk) 13:00, 6 April 2021 (UTC)

==Discussion at Wikipedia:Village pump (proposals) § Switch to BrandonXLF's link count tool and remove Jarry1250's tool from Special:WhatLinksHere== You are invited to join the discussion at Wikipedia:Village pump (proposals) § Switch to BrandonXLF's link count tool and remove Jarry1250's tool from Special:WhatLinksHere. 🐶 EpicPupper (he/him &#124; talk) 04:16, 13 February 2022 (UTC)

Protected edit request on 19 December 2022: add "Sorted list" external tool
Change

External tools:
 * [//linkcount.toolforge.org/?project=en.wikipedia.org&page= Link count]
 * [//templatecount.toolforge.org/index.php?lang=en&namespace=&name= Transclusion count]

to

External tools:
 * [//linkcount.toolforge.org/?project=en.wikipedia.org&page= Link count]
 * [//templatecount.toolforge.org/index.php?lang=en&namespace=&name= Transclusion count]
 * [//wlh.toolforge.org/pages/?ns= Sorted list]

Hello community,

, and I have been working together on an external tool to be added to  MediaWiki:Linkshere  and thus included on all Special:WhatLinksHere pages on English Wikipedia. This tool, hosted on Toolforge at, https://wlh.toolforge.org/, provides a sortable list of backlinks (redirects and indirect backlinks through redirects are coming soon) sorted by default in alphabetical order. This has been a requested feature of MediaWiki core since 2005 and a frequently top requested item in the Community WishList Survey. We decided to implement this as an external tool instead of patch to MediaWiki core because there are some concerns about performance implications for well-linked pages on larger wikis. Using toolforge mitigates this risk by allowing us to roll out this tool one wiki at a time targeting the toolforge replica of the wiki’s database while monitoring the performance for slow queries. We’re pleased to report that so far, the tool seems performant. For instance, the DB queries for https://wlh.toolforge.org/Philosophy finish in less than 0.5 seconds, and the front-end page loads in about 1 second.

We hope the community will accept the proposal to include this as an external tool titled "Sorted list" on the Special:WhatLinksHere pages alongside the other tools: "Link count," and "Transclusion count." We are also eager to receive your feedback and contributions to improve the tool. The phabricator board for this tool is at phab:project/profile/6307/. A working example of this tool embedded in a Special:WhatLinksHere page can be seen on Beta-Cluster.

Thanks for your consideration! SDunlap-WMF (talk) 19:19, 19 December 2022 (UTC)


 * Where is the source code for the new tool? Legoktm (talk) 21:22, 19 December 2022 (UTC)
 * Source code lives on Gitlab currently (this could be moved into Gerrit eventually if desired):
 * Front-end: https://gitlab.wikimedia.org/repos/abstract-wiki/wlh
 * Back-end (Rust service): https://gitlab.wikimedia.org/repos/abstract-wiki/wlh-api
 * EGardner (WMF) (talk) 22:37, 19 December 2022 (UTC)
 * @EGardner (WMF): thanks, however I couldn't find any license statement in either of those repositories. Please see "Pick a license". Excited to see more Rust code! Legoktm (talk) 23:13, 19 December 2022 (UTC)
 * @Legoktm will do (https://phabricator.wikimedia.org/T325605). Your Rust Toolforge tutorial was very helpful in getting this project going by the way! EGardner (WMF) (talk) 23:30, 19 December 2022 (UTC)
 * @Legoktm thank you for pointing that out. We had specified GPL v3 on our Toolforge projects, https://toolsadmin.wikimedia.org/tools/id/wlh and https://toolsadmin.wikimedia.org/tools/id/wlh-api, but forgot to add them to our GitLab repos. I just added them. SDunlap-WMF (talk) 04:13, 20 December 2022 (UTC)
 * @SDunlap-WMF is tool going to be supported by the foundation? What is the support model and where is that documented? I don't see info on wikitech, and the tool has no feedback or support buttons on it. —  xaosflux  Talk 21:57, 19 December 2022 (UTC)
 * @Xaosflux the short answer is yes, it will be supported by the foundation. All three of us on interested in continuing to be active maintainers and contributors on the project. In the event that we weren't available to support it, as a tool made during the CommTech Wishathon, it would go on being supported by the CommTech team. I can't speak for the others, but I expect to have bandwidth to keep supporting this tool for the foreseeable future. Additionally, thank you for you feedback, I've added a link to our Phabricator board and source code to navigation bar of our tool. SDunlap-WMF (talk) 04:33, 20 December 2022 (UTC)


 * Example output: https://wlh.toolforge.org/pages/Philosophy — xaosflux  Talk 10:54, 20 December 2022 (UTC)
 * any other concerns? It seems to work, looks useful, license and support exist. — xaosflux  Talk 11:01, 20 December 2022 (UTC)
 * Nope, looks good to me as well. Thanks to those who worked on this! Legoktm (talk) 19:43, 21 December 2022 (UTC)
 * ✅ this tool has been added, thank you. —  xaosflux  Talk 11:30, 22 December 2022 (UTC)

Stray whitespace after latest edit
After this edit, there is an unwanted space between the open parenthesis and the word "link". I think it could be fixed by moving the open parenthesis to just before the opening bracket in the first link:  Pinging .~ – Jonesey95 (talk) 16:07, 4 January 2024 (UTC)
 * ✅ — xaosflux  Talk 16:39, 4 January 2024 (UTC)