Page MenuHomePhabricator

Special:Unusedtemplates filtering
Open, Needs TriagePublic


Hi! I succeed to reduce this special list on wp:fr to 1 559 templates. Not only by removing obsolete templates but using it in the documentation. The problem is that it is normal that some listed templates are unused (sandbox, testcases, substituted templates, preload…). I created a category on wp:fr including all exceptions (903 templates). It will be really helpful if a filtering option using a category is added to all Wikipedias. Many thanks.

Event Timeline

FDo64 created this task.Jan 10 2018, 6:17 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJan 10 2018, 6:17 PM
Framawiki updated the task description. (Show Details)Jan 11 2018, 9:05 PM
Framawiki added subscribers: Framawiki, Niharika.

@Framawiki Why did I get subscribed here?

@Framawiki Why did I get subscribed here?

I thought you might be interested, since a similar request was opened on one of your GH projects. I apologize if I made a mistake, don't hesitate to remove yourself from the list.

@Framawiki Ah, I missed that request. Thanks for that.

I think you need to explain better what exactly is required here and why. Is it possible to create a dummy page where these unused templates are used and that'd get them off the list?

FDo64 added a comment.Mar 25 2018, 8:30 AM

@Niharika Hi ! First of all, sorry for answering so late but I’m really not familiar with Phabricator and this is the first time I'm posting a request.
Second, we already use this trick of using templates in a dummy page. The problem is that it cannot be used for most of the remaining templates I put in this category (sandbox, test cases, substituted templates, preload, KML code…). In addition, the advantage of using a category is that contrary to a dummy page or a whitelist it will be dynamic. No need of updating such a page.
Another trick I'm using each time it is possible is to use the template in its own documentation. Thousand of templates have been removed from this list this way.
As a workaround solution and if a category is not suitable, we could request a bot to periodically generate a whitelist from the category I created (and all sub-categories).
As a conclusion: Filtering options in all special lists would really improve all maintenance tasks.
If something is still not clear, do not hesitate to request me more information.

Thanks for more info, @FDo64. It will be hard to use categories to do this filtration on Special:UnusedTemplates because the query for UnusedTemplates runs on every project. Filtering by category would make it enwiki-specific. :(

However filtering out by category should be fairly easy to do in the bot code for BernsteinBot which generates that report on wiki. Maybe talk to its owner about it?

It would be possible to let the user specify in a form which category to excude. But as far as I know, MW should not implement recursive category querying for performance reasons. In this case, excluding a single category would be unuseful.

FDo64 added a comment.Feb 14 2019, 8:00 PM

@Niharika, @Framawiki,@Louperivois: Hi ! I’m back today with a new idea, probably easiest to implement.
I’m currently working on Special:UnusedCategories and there is a magic word doing the same kind of job I’m requesting:


Could we envisage creating the following magic word?


Then, all templates containing this magic word should be filtered in the Special:Unusedtemplates page.
Your thoughts?

Hi @FDo64, it seems to be a very good solution for this issue.