User:AnomieBOT/docs/TemplateSubster
Certain templates should always be substituted, although people sometimes forget. It's quite easy for a bot to go through these templates and subst them. AnomieBOT does this for all templates in Category:Wikipedia templates to be automatically substituted.
How it works
[edit ]AnomieBOT simply goes through all templates listed in Category:Wikipedia templates to be automatically substituted, loads the list of transclusions for each, and edits each transcluding page to subst the templates. Specifically, it changes {{foo}} to {{subst:foo|subst=subst:}} (the parameter |subst= set to "subst:" is a common workaround in templates that predate the introduction of safesubst:).
To allow for example usage, AnomieBOT will not subst template instances that have the parameters |nosubst= or |demo=. To prevent disruption, AnomieBOT will also not subst any template that has over 100 transclusions unless that template is linked from User:AnomieBOT/TemplateSubster force.
What to do if AnomieBOT substs a template it shouldn't?
[edit ]If the template should not be substituted automatically, edit it to remove it from Category:Wikipedia templates to be automatically substituted. If just the one instance should not be substed (e.g. uses as examples), add |nosubst= or |demo= to the template invocation. You might want to edit the template to recognize |demo= anyway to avoid it adding inappropriate categories and the like.
If necessary, you can also post a message to User:AnomieBOT/shutoff/TemplateSubster to stop the bot and post a message to User talk:AnomieBOT to let Anomie know about the problem.
What to do if AnomieBOT does not subst a template it should?
[edit ]Try the following:
- Make sure the template really is in Category:Wikipedia templates to be automatically substituted.
- Make sure {{nobots }} or {{bots }} is not present on the page, and the page is not protected.
- Make sure the template is being directly transcluded in the page. Transclusion via other templates or modules (including things like
{{tlg|_show_result=y}}) are not substed by the bot. - Make sure the instance of the template is not using
|nosubst=or|demo=. - Make sure the template has fewer than 100 transclusions.
- If it does have that many transclusions, you will need to either subst those transclusions yourself or add a link to it from User:AnomieBOT/TemplateSubster force.
- If all else fails, ask for help at User talk:AnomieBOT.
Can AnomieBOT treat some template specially?
[edit ]No. The TemplateSubster task only knows that the template has been requested for bot substitution, it doesn't know anything about the contents or usage of any template. If a template so often needs special treatment that bot-substing causes an unacceptable rate of problems, and these problems can't be fixed by editing the template (e.g. adding missing safesubst:), then it probably should be removed from Category:Wikipedia templates to be automatically substituted and periodically cleaned up by interested humans instead.
Specific to duplicate WikiProject banners, ultimately the error is on the human who added a defunct subproject's banner when the parent project banner it substs to was already present. See also Garbage in, garbage out.