Hiding MediaWiki meta generator version


MediaWiki includes this header meta tag in pages:

<meta name="generator" content="MediaWiki x.x.x"/>

Someone asking on the official Phabricator didn’t get any useful answers, especially if you need it for compliance.

As of the time of writing, you can change this block in ./includes/OutputPage.php to remove the version:

$tags['meta-generator'] = Html::element( 'meta', [
	'name' => 'generator',
	'content' => 'MediaWiki',
] );

You’ll also want to redirect or block the Special:Version page and README files in your web server config, and review API access.

You should still credit MediaWiki, given their server software is running your site.

Author bio and support


Ruben Schade is a technical writer and infrastructure architect in Sydney, Australia who refers to himself in the third person. Hi!

The site is powered by Hugo, FreeBSD, and OpenZFS on OrionVM, everyone’s favourite bespoke cloud infrastructure provider.

If you found this post helpful or entertaining, you can shout me a coffee or send a comment. Thanks ☺️.