Wikipedia talk:Database reports/Unused templates

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

Question[edit]

Is it possible to exclude Category:Wikipedia transclusionless templates? Bulwersator (talk) 12:50, 8 December 2011 (UTC)[reply]

Hi Bulwersator. Sure, done. --MZMcBride (talk) 22:37, 26 December 2018 (UTC)[reply]

Instructions requested[edit]

Please provide instructions for this list, with examples.--Dthomsen8 (talk) 16:53, 11 September 2016 (UTC)[reply]

Huh? --MZMcBride (talk) 04:10, 12 September 2016 (UTC)[reply]

Transclusionless is not unused[edit]

When a template is called only from within a module, then this does not show up as a link/transclusion, so the template ends up here. An example is {{Create taxonomy}}, which is only used in Module:Autotaxobox (currently with about 220,000 uses). Maybe it's technically infeasible to count uses from a module, but it should be clearly understood that this category does not only contain unused templates. Peter coxhead (talk) 17:55, 25 December 2018 (UTC)[reply]

Hi Peter coxhead. You may want to add that template to Category:Wikipedia transclusionless templates. It looks like this report is supposed to be excluding templates that are in Category:Wikipedia substituted templates, but the report likely does not recognize the "transclusionless" templates category currently. --MZMcBride (talk) 22:28, 26 December 2018 (UTC)[reply]
@MZMcBride: I was put off using {{Transclusionless}} because the members of Category:Wikipedia transclusionless templates are templates that it would be an error to transclude – either because they should be substituted or because they should never be used. This isn't true of templates currently used only from within a module, perhaps because the original transcluding template was converted to Lua; if they were useful they could perfectly well be used from a template in a different context.
Furthermore {{Create taxonomy}} isn't transclusionless; articles whose taxoboxes are incorrect in particular ways will show up under "What links here", some transiently as they get fixed, and some permanently, like error test cases.
Perhaps what is needed is a way of marking templates whose transclusion count does not reflect their actual or potential use count because all or some of those uses are from modules. Peter coxhead (talk) 08:58, 27 December 2018 (UTC)[reply]

Redirects to substituted templates[edit]

This report misleadingly includes lots of redirects to substituted templates, e.g. {{Rfd-relisted}} is a redirect to {{Rfd relisted}}. The target is a member of Category:Wikipedia substituted templates and so correctly excluded but the redirects are not (and by my understanding should not be). Thryduulf (talk) 13:08, 21 May 2019 (UTC)[reply]

Hi Thryduulf. I happened to look at this issue just now because of the bug mentioned directly below regarding Category:Wikipedia substituted templates. Template:Rfd relisted was not being excluded from this report because of its membership in that category due to the bug. Instead, Template:Rfd relisted was being excluded because it has a single transclusion at Template:Rfd relisted/Test cases, which I believe makes the template be considered "used". That really makes you wonder how many other templates are similarly situated. --MZMcBride (talk) 08:28, 2 January 2020 (UTC)[reply]
@MZMcBride: I noticed this too because I use a script which colours redirects and showed that all but two of the 5000 links to templates on WP:Database reports/Unused templates/12 are redirects. Of the few template redirect targets I checked, the templates all had transclusions. It might be best if the script just ignored redirects altogether. —Somnifuguist (talk) 05:36, 25 August 2021 (UTC)[reply]
I just discovered this report, and i can’t find a single listing that isn’t a redirect. Of course redirects will be unused. The report is useless now. I know most of them are not tagged as redirects, but there are other ways to determine if a page is a redirect and exclude them. --awkwafaba (📥) 11:47, 4 November 2021 (UTC)[reply]
Start at Wikipedia:Database reports/Unused templates/1 to find non-redirects. – Jonesey95 (talk) 15:17, 4 November 2021 (UTC)[reply]

Is the report excluding subst-only templates?[edit]

I think that this report is supposed to exclude subst-only templates, possibly by ignoring templates in Category:Wikipedia substituted templates, but I am seeing {{Nuclear Barnstar}} in the current report at Wikipedia:Database reports/Unused templates/2. Is there someone watching this page who can look into this apparent problem? – Jonesey95 (talk) 20:27, 1 January 2020 (UTC)[reply]

Another example is {{Bollywood Star}}, which is on the first page. – Jonesey95 (talk) 20:36, 1 January 2020 (UTC)[reply]
Huh, nice catch. It looks like a bug I introduced about two years ago, based on this edit. If you have any interest in working on the scripts that generate these database reports, this would be a fun first bug to locate. :-) --MZMcBride (talk) 08:15, 2 January 2020 (UTC)[reply]
I don't see what could have changed to cause these templates to reappear (if they were ever excluded correctly), but I don't read python. There are also a whole lot of redirects to (used) stubs in Wikipedia:Database reports/Unused templates/16; I think it is OK to have unused redirects. – Jonesey95 (talk) 15:10, 2 January 2020 (UTC)[reply]