Extensions/NoTitle/NoTitle.php

<?php
 
$wgExtensionCredits['parserhook'][] = array(
        'name' => 'No title',
        'author' => 'Nx',
        'description' => 'Adds a magic word to hide the title heading.'
);
 
$wgHooks['LanguageGetMagic'][] = 'NoTitle::addMagicWordLanguage';
$wgHooks['ParserBeforeTidy'][] = 'NoTitle::checkForMagicWord';
 
class NoTitle
{
 
  static function addMagicWordLanguage(&$magicWords, $langCode) {
    switch($langCode) {
    default:
      $magicWords['notitle'] = array(0, '');
    }
    MagicWord::$mDoubleUnderscoreIDs[] = 'notitle';
    return true;
  }
 
  static function checkForMagicWord(&$parser, &$text) {
    if ( isset( $parser->mDoubleUnderscores['notitle'] ) ) {
      $parser->mOutput->addHeadItem('/*<![CDATA[*/ .firstHeading, .subtitle, #siteSub, #contentSub, .pagetitle { display:none; } /*]]>*/');
    }
    return true;
  }
 
}