From MediaWiki.org
Jump to navigation Jump to search
MediaWiki extensions manual
Crystal Clear action run.svg
Release status: beta
Wikipedia Zero Logo.svg
Implementation MyWiki, Special page, ContentHandler, Skin
Description Provides features for mobile providers that provide free access to Wikipedia
Author(s) Yuri Astrakhan (yuriktalk)
Latest version 1.1.0 (2016-12-07)
MediaWiki 1.28+
PHP 5.5.9+
Database changes No
License GNU General Public License 2.0 or later
  • $wgJsonConfigs
  • $wgZeroSiteOverride
  • $wgZeroBannerClusterDomain
  • $wgZeroBannerImageFontSize
  • $wgZeroBannerImageWidth
  • $wgZeroBannerImageHeight
  • $wgZeroBannerErrImageWidth
  • $wgZeroBannerErrImageHeight
  • $wgZeroBannerFont
Hooks used
Translate the ZeroBanner extension if it is available at translatewiki.net
Check usage and version matrix.
Issues Open tasks · Report a bug

The ZeroBanner extension provides banner, hyperlink, and image treatment for webpages for the Wikipedia Zero program. This extension is a refactoring of ZRMA extension


  • If using Vagrant , install with vagrant roles enable zero --provision
Manual installation
  • Download and place the file(s) in a directory called ZeroBanner in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php:
    require_once "$IP/extensions/ZeroBanner/ZeroBanner.php";
    Configure at your convenience
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.


$wgJsonConfigs['JsonZeroConfig'] = array(
   'namespace' => NS_ZERO,
   'nsname' => 'Zero',
   'islocal' => false,
   'url' => 'https://zero.wikimedia.org/w/api.php',
   'username' => $wmgZeroRatedMobileAccessApiUserName,
   'password' => $wmgZeroRatedMobileAccessApiPassword,

See the README for more information on configuration and settings pertaining to carrier mockup.

For local (test) wikis, try just the following:

$wgJsonConfigs['JsonZeroConfig'] = array(
    'namespace' => NS_ZERO,
    'nsName' => 'Zero',
    'remote' => array(
        'url' => 'http://localhost:8888/w/api.php'
    'cacheKey' => '1',
$wgZeroSiteOverride = array( 'wikipedia', 'en' );

Setting up local wiki[edit]

  • Install a browser extension for modifying request headers such as ModHeader for Chrome
  • Navigate to Zero:TEST on your wiki and create the page. Some default configuration is provided, but the JSON below may prove more useful:
    "comment": "[Zero] TEST",
    "enabled": true,
    "name": {
        "en": "Test Operator"
    "banner": {
        "en": "{{SITENAME}} zero-rating test on $1"
    "partnerInfoText": {
        "en": "Check your quota"
    "partnerInfoUrl": "https://www.google.com",
    "showLangs": [
    "shrinkImg": true,
    "configs": [
            "whitelistedLangs": [],
            "enableHttps": true,
            "bannerWarning": true
    "ipsets": {
        "default": []
    "status": {
        "technical": "edit"
    "country": "US"
  • Add 3 new request headers in your extension:
    • X-CS: TEST
    • User-Agent: android-mobile
    • X-Subdomain: M
  • Optionally add a filter to only apply these headers to your local environment
  • Navigate to Main Page (or any article) on your local wiki. You should now see a banner rendered at the top of the article.

See also[edit]