From mediawiki.org
Jump to navigation Jump to search
Other languages:
English • ‎Türkçe • ‎français • ‎中文 • ‎日本語
MediaWiki extensions manual
OOjs UI icon advanced.svg
Release status: stable
Implementation MyWiki
Description Allows pages to be excluded from Special:Random
Author(s) Matt Russell (ultradude25talk)
Latest version 2.0.0 (2018-09-08)
MediaWiki 1.16+
PHP 5.1+
Database changes No
License BSD 3-clause "Modified" License
  • $wgExcludeRandomPages
Check usage and version matrix.

The Special:MyLanguage/Help:Random page extension allows pages to be excluded from Special:Random. For example, this could be useful for hiding in-complete translation pages that have been yet to be moved to their own sub-domain.


  • Download and place the file(s) in a directory called ExcludeRandom in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php:
    wfLoadExtension( 'ExcludeRandom' );
  • Yes 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( 'ExcludeRandom' );, you need to use:

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


The list of pages to be excluded, in an array. * wildcard is supported (matches any amount of any characters).


$wgExcludeRandomPages = array( 'Main Page', '*/fr' );

This will disallow Main Page and anything/fr from being selected by Special:Random.