Extension:Random In Category

From MediaWiki.org
Jump to: navigation, search

Other languages:
English • ‎español • ‎italiano • ‎日本語 • ‎português • ‎português do Brasil
MediaWiki extensions manualManual:Extensions
Crystal Clear action run.png
Random In Category

Release status:Extension status stable

ImplementationTemplate:Extension#type Special page
DescriptionTemplate:Extension#description Direct the user to a random page in a specified category
Author(s)Template:Extension#username Victor Vasiliev (VasilievVVtalk)
Latest versionTemplate:Extension#version 2.0 (2011-01-31)
MediaWikiTemplate:Extension#mediawiki 1.16+
Database changesTemplate:Extension#needs-updatephp No
LicenseTemplate:Extension#license GPLv2+

Translate the Random In Category extension if it is available at translatewiki.net

Check usage and version matrix.

The Random In Category extension allows you to direct the user to a random page in a specified category.


Very similarly to Special:Random, you can specify a category name as a parameter to the page. Thus, "Special:RandomInCategory/Foo" or "Special:RandomPageInCategory/Foo" (MW ≥ MW 1.22) will get you a page from the "Foo" category.

Comparison to Core[edit]

MediaWiki version: 1.22

In MediaWiki 1.22, a Special:RandomInCategory feature was added to core. The core version gives much more biased results than this extension (However, it has much less performance overhead). Versions of this extension for MediaWiki 1.22 and greater change the name that this extension provides from "Special:RandomInCategory" to Special:RandomPageInCategory to prevent conflict with the core feature.


The extension can be retrieved directly from Git [?]:

  • Browse code
  • Some extensions have tags for stable releases.
  • Each branch is associated with a past MediaWiki release. There is also a "master" branch containing the latest alpha version (might require an alpha version of MediaWiki).

Extract the snapshot and place it in the extensions/RandomInCategory/ directory of your MediaWiki installation.

If you are familiar with git and have shell access to your server, you can also obtain the extension as follows:

cd extensions/
git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/RandomInCategory.git


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