Wikipedia talk:Database reports/Unused templates

Question
Is it possible to exclude Category:Wikipedia transclusionless templates? Bulwersator (talk) 12:50, 8 December 2011 (UTC)
 * Hi Bulwersator. Sure, done. --MZMcBride (talk) 22:37, 26 December 2018 (UTC)

Instructions requested
Please provide instructions for this list, with examples.--Dthomsen8 (talk) 16:53, 11 September 2016 (UTC)
 * Huh? --MZMcBride (talk) 04:10, 12 September 2016 (UTC)

Transclusionless is not unused
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)
 * 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)
 * 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)

Redirects to substituted templates
This report misleadingly includes lots of redirects to substituted templates, e.g. is a redirect to. 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)
 * 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)
 * @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)
 * 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)
 * Start at Database reports/Unused templates/1 to find non-redirects. – Jonesey95 (talk) 15:17, 4 November 2021 (UTC)

Is the report excluding subst-only templates?
I think that this report is supposed to exclude subst-only templates, possibly by ignoring templates in, but I am seeing Nuclear Barnstar in the current report at 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)
 * Another example is Bollywood Star, which is on the first page. – Jonesey95 (talk) 20:36, 1 January 2020 (UTC)
 * 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)
 * 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 Database reports/Unused templates/16; I think it is OK to have unused redirects. – Jonesey95 (talk) 15:10, 2 January 2020 (UTC)