From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manualManual:Extensions
Crystal Clear action run.png

Release status:Extension status stable

ImplementationTemplate:Extension#type User interface, MyWiki
DescriptionTemplate:Extension#description Alphabetizes category links at the bottom of an article
Latest versionTemplate:Extension#version 0.4.0 (2018-02-05)
MediaWikiTemplate:Extension#mediawiki >=1.29
PHPTemplate:Extension#php 5.3+
Database changesTemplate:Extension#needs-updatephp No
LicenseTemplate:Extension#license Apache License 2.0
Hooks usedTemplate:Extension#hook

Translate the CategoryTagSorter extension if it is available at translatewiki.net

Check usage and version matrix.


Open tasks · Report a bug

The CategoryTagSorter extension alphabetizes category links at the bottom of an article.


A MediaWiki article typically displays the list of category links in the order in which they appear in the article. For articles with many categories, it can be difficult for readers to find the category they're looking for. This extension fixes this by alphabetizing category links.

Sorting is ascii-betical, which usually works out OK as most wikis are configured to have the first letter of a title be uppercase (see $wgCapitalLinks.)

This extension includes a user preference for individuals who prefer MediaWiki's default behavior.


  • Download and place the file(s) in a directory called CategoryTagSorter in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php:
    wfLoadExtension( 'CategoryTagSorter' );
  • YesY Done - Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

To users running MediaWiki 1.24 or earlier:

The instructions above describe the new way of installing this extension using wfLoadExtension() If you need to install this extension on these earlier versions (MediaWiki 1.24 and earlier), instead of wfLoadExtension( 'CategoryTagSorter' );, you need to use:

require_once "$IP/extensions/CategoryTagSorter/CategoryTagSorter.php";

User preference option[edit]

This extension provides a user-preference option added in the Appearance section which allows users to turn off the alphabetizing of the categories. By default this extension is enabled. To set the default behavior to disabled (a opt-in type of extension), set the categorysortdisabled preference to 1 in the default user preferences.[1] Like so:

$wgDefaultUserOptions['categorysortdisable'] = 1;


  1. Thanks goes to Matma Rex for this trick.

See also[edit]