1

I tried to change the title of the main page of a MediaWiki-powered website from "Main Page" to "My Unique Title," via adding this snippet into Wiki-code for the main page.

{{DISPLAYTITLE: My Unique Title}}

However, it does nothing. How do I change the title of the main page of a MediaWiki-powered website?

6

If you want to use {{DISPLAYTITLE:}} to change a display title completely (as in, not just different capitalization), you'll need to make a change in LocalSettings.php.

Set [$wgRestrictDisplayTitle][1] to false.

Additionally, if you're looking to change where the main page resides, you can change [[MediaWiki:Mainpage]] to change the default main page users are sent to.

1

Try this: your-wiki-address/w/index.php?title=MediaWiki:Pagetitle-view-mainpage

We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.

0

If you want to completely rename the front page of your wiki from "Main Page" to something else, then...

The DISPLAYTITLE magic word, has several disadvantages: This is only used for modifying the display of the title of the page, but the URL will (confusingly!) still be "Main_Page". It's only really intended for subtle modifications of the page title display (e.g. capitalisation changes), and won't allow you to do more unless you make a config change: $wgRestrictDisplayTitle=false. That config change then applies throughout your wiki (It allows any user to similarly rename the display title of any other page, making it out of alignment with page's true name and URL). You'll still have to link it with [[Main Page]]. And finally the magic word will be visible in your wiki text, which may or may not bother you. All in all this is not a great solution to renaming your "Main Page".

Another half-solution, which you've probably already thought of, is to just 'move' the Main Page to a different page name. Help:Moving a page. Because this leaves behind a redirect, visitors will be taken to the new page title. However this is half solution because you'll always see the little "redirected from 'Main Page" text at the top. The URL still contains 'Main_Page', and the side bar on the left does too.

The correct way to completely tell MediaWiki to work with different front page title: Alter the contents of 'MediaWiki:Mainpage' to point to a different title. This is a special 'system message' pages which you cannot modify without having administrator rights. Set yourself up with administrator rights if you didn't do this already.

After a refresh this should also change the 'Main Page' link in the sidebar, but if it does not, you may need to modify the 'MediaWiki:Sidebar' system page.

This is on the MediaWiki FAQ

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.