There's probably not much benefit in search engines indexing the API
auto-generated help or various random "format=jsonfm" outputs.
On Wikimedia wikis we already have a robots.txt entry denying indexing
of everything under /w/, which includes api.php.
Bug: T207818
Change-Id: I196d401eeb5fcf49844265df41ad3cce83ffdcdf
$out = new OutputPage( $context );
$context->setOutput( $out );
+ $out->setRobotPolicy( 'noindex,nofollow' );
$out->addModuleStyles( 'mediawiki.apipretty' );
$out->setPageTitle( $context->msg( 'api-format-title' ) );
$context->setLanguage( $this->getMain()->getLanguage() );
$context->setTitle( SpecialPage::getTitleFor( 'ApiHelp' ) );
$out = new OutputPage( $context );
+ $out->setRobotPolicy( 'noindex,nofollow' );
$out->setCopyrightUrl( 'https://www.mediawiki.org/wiki/Special:MyLanguage/Copyright' );
$context->setOutput( $out );