Search code examples
mediawikimediawiki-templates

How to resolve template loop detected issue in MediaWiki


Recently, I have installed MediaWiki version 1.22 onto my local machine. I have added few templates pages, when I'm trying to use them, it displays

Template loop detected:

template loop detected

I also deleted some of old pages using admin login, but still it showing the same problem.


Solution

  • Template loops happen when two templates are transcluding each other, for example

    Template:Foo contains {{bar}}

    while Template:Bar contains {{foo}}

    This can happen also through intermediate templates, e.g. foo transcludes bar which transcludes baz which transcludes foo.

    Since I haven't seen your templates I can't tell what exactly is wrong, but the general advice is to look at your templates' source.