Manual:$wgNonincludableNamespaces

Details
This code stops users from reading a MediaWiki site. These read-restrictions otherwise could be bypassed by using a template.

These Namespaces pages listed cannot be used as templates.

(Elements must be numeric namespace IDs or namespace constants).

or