Jump to content

New variables (magic words) for number of unique linked pages/articles on a page (Community Wishlist/W415)

Community opportunity
From Meta, a Wikimedia project coordination wiki

View all wishes.

Description

We currently have a good number of Magic Words that exist for the sake of providing shortcuts to useful statistics. With this wish, I am proposing two new statistical Magic Words:

  • {{PAGESONPAGE: Pagename }} – Number of unique pages linked on Pagename (alternative: PAGELINKSONPAGE)
  • {{ARTICLESONPAGE: Pagename }} – Number of unique articles linked on Pagename (alternative: ARTICLELINKSONPAGE)

For my purposes and I think reasonable common purposes, many reports produced on Wikipedia are lists of linked pages, which are often lists of linked articles (subset of pages). For that matter, outside of reports, articles and most pages are effectively a container if not list of such links.

For the sake of reports, these new Magic Words would be useful for the sake of demonstrating the relative weight of issues in comparative concerns (e.g. number of orphaned/isolated articles vs. number of articles with citation errors), demonstrating progress toward a goal of addressing issues, and/or administering backlogs of listed issues. Having a shortcut to a number showing how many pages/articles are in a report would, in my view, enhance productivity in these scenarios.

For the sake of regular pages and articles, there well could be all kinds of use cases from the capability of showing how many pages/articles are linked on them. One obvious use would be making it easy for anyone to track the growth of links on an article, which in comparison with the article's size (via Magic Word PAGESIZE) can lead to useful ongoing metrics.

To my knowledge, the internal wiki database should already accommodate the determinations required to implement these Magic Words. As for the performance hit of doing this, I can't really speak to that fully, but given that pages are cached and databases have indexes, I think any necessary adjustments would be few.

Update: The above idea, simplified

Upon requesting a template/module on enwiki, I realized my wish could be simplified to the following:

Akin to {{NUMBEROFSECTIONS}}, I'd like to have a template called {{NUMBEROFUNIQUELINKS}}.

To get the number of unique mainspace links on a page, in this example, a WikiProject report page, the code would look like {{NUMBEROFUNIQUELINKS|Wikipedia:WikiProject Kentucky/OldIssues|ns=0}}

The default for ns would be for "all namespaces", returning the number of all unique pages that are linked.

My particular need for this is to obtain the number of unique articles (in the form of internal links) returned in the results of a {{Database report}} on a page. I use such reports to create specialized lists of issues in articles. With the number returned, I can use it to demonstrate when a backlog exists, or for comparing the number of articles affected between different types of issues (useful for backlog ordering), or for comparing the number of articles affected by a particular type of issue between different WikiProjects.

I assume this will require an underlying module.

Assigned focus area

Unassigned

Type of wish
Feature request
Affected users

Report creators, administrators of WikiProjects and other group efforts, and general power users

Phabricator tasks
Other details
  • Created: 00:38, 15 August 2025
  • Last updated: 20:42, 29 November 2025
  • Author: StefenTower (talk)
Voting

This wish currently has 1 supporter. Voting for this wish is open until it is completed.

Supporters of this wish
Support Support as author. StefenTower (talk) 23:46, 26 October 2025