FANDOM


{{module rating|alpha}}
 
This is a simple module to strip [[Help:Category|categories]] from [[Help:Wiki markup|wikitext]]. For example, if passed the code "<code><nowiki>foo[[Category:Some category]]</nowiki></code>", it will return only "<code>foo</code>".
 
The module properly handles categories escaped with the [[Help:Colon trick|colon trick]], categories whose names include invalid characters such as "<code>></code>", and categories that are surrounded with [[WP:NOWIKI|nowiki]] tags. However, it does not support complex wikitext such as nested links or [[WP:MAGIC|magic words]] like <code><nowiki>__TOC__</nowiki></code>. Even so, it should still remove the vast majority of categories from any given wikitext.
 
== Usage ==
 
{{pre|<nowiki>{{#invoke:Suppress categories|main|</nowiki>''input text''<nowiki>}}</nowiki>}}
 
== Examples ==
 
{| class="wikitable"
|-
! Code
! Output
|-
| <code><nowiki>{{#invoke:Suppress categories|main|foo}}</nowiki></code>
| {{#invoke:Suppress categories|main|foo}}
|-
| <code><nowiki>{{#invoke:Suppress categories|main|foo[[Category:Some category]]}}</nowiki></code>
| {{#invoke:Suppress categories|main|foo[[Category:Some category]]}}
|-
| <code><nowiki>{{#invoke:Suppress categories|main|foo[[Category:Some category]]bar[[Category:Another category]]}}</nowiki></code>
| {{#invoke:Suppress categories|main|foo[[Category:Some category]]bar[[Category:Another category]]}}
|-
| <code><nowiki>{{#invoke:Suppress categories|main|foo{{{some_parameter|[[Category:Bar]]}}}}}</nowiki></code>
| {{#invoke:Suppress categories|main|foo{{{some_parameter|[[Category:Bar]]}}}}}
|-
| <code><nowiki>{{#invoke:Suppress categories|main|foo[[Category:Bad ca[]tegory link]]}}</nowiki></code>
| {{#invoke:Suppress categories|main|foo[[Category:Bad ca[]tegory link]]}}
|-
| <code><nowiki>{{#invoke:Suppress categories|main|foo[[:Category:Colon trick]]}}</nowiki></code>
| {{#invoke:Suppress categories|main|foo[[:Category:Colon trick]]}}
|-
| <code><nowiki>{{#invoke:Suppress categories|main|foo[[Category:Piped link|bar]]}}</nowiki></code>
| {{#invoke:Suppress categories|main|foo[[Category:Piped link|bar]]}}
|-
| <code><nowiki>{{#invoke:Suppress categories|main|foo[[Category:Piped link|ba[]r]]}}</nowiki></code>
| {{#invoke:Suppress categories|main|foo[[Category:Piped link|ba[]r]]}}
|-
| <code><nowiki>{{#invoke:Suppress categories|main|foo[[non-category link]]}}</nowiki></code>
| {{#invoke:Suppress categories|main|foo[[non-category link]]}}
|-
| <code><nowiki>{{#invoke:Suppress categories|main|foo[[ Category : Some category with spaces ]]}}</nowiki></code>
| {{#invoke:Suppress categories|main|foo[[ Category : Some category with spaces ]]}}
|-
|}
 
== See also ==
 
* [[Wikipedia:Category suppression]]

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.