Introduction
Yes, it looks ugly. It looks a bit better now than it used to in earlier versions of the MediaWiki distribution, but still… it’s just begging to be replaced and you would think it would be just a little more straightforward since it is one of the first things you notice on the wiki site. Yes, that default MediaWiki logo just has to go!
Changing the logo
It’s not that difficult, but you will need access to the web server’s file system. Start off by getting hold of a replacement image, preferably something about the same size and shape as the original.
The default logo is of type png and size 135 x 135 pixels. Locate your LocalSettings.php file in your wiki directory. The wiki directory is probably the wiki/ directory in the document root of your web server. When you have found the file then open it for edit.
Search the file for the string $wgScriptPath. It should refer to the URL base path to the directory meaning is is most likely set to the value “/wiki” or similar. At the end of the file add the following two lines,
$wgStylePath = “$wgScriptPath/skins”;
$wgLogo = “$wgStylePath/common/images/<image>”;
where you replace the text <image> with the filename of your replacement logo image. Then place your new logo file in the directory as referred to by the full path contained in the $wgLogo variable. And that’s all there is to it, really. The change will take effect immediately after you save the LocalSettings.php file, but make sure you don’t forget to end the statements with mandaroty semi-colons on each added line and also make sure the lines come before any closing “?>” at the end of the file. The file must still be valid PHP code when you are finished, after all.
Summary
Your results should look something like in the figure below. I can’t remember where I found the image I am using for my MediaWiki instance, but it is a gif image of size 84 x 64 pixels. As I mentioned earlier, the original default logo image is of type png and size 135 x 135 pixels.