Knowledgebase

How to remove links to talk pages and user pages of anonymous users in MediaWiki

By default, when an anonymous user visits and browses your MediaWiki site, the IP address of the user is shown in the area where the user links are located (at the top of the site). It's a link to the personal page of the user; unregistered users can also have personal pages. The IP address is used for the title of the page. By clicking on the link the user can open the form for creating the page (provided that anonymous users have the permission to edit content). If the page exist, the IP address link will simply open the page. Next to the IP address there's a link to the associated discussion/talk page; it's labeled Talk for this IP address. These links are shown in the header on every page of the site.

When anonymous users edit pages their IP addresses and links to the talk pages are also shown on the various lists with page edits (e.g. Recent changes page, page histories, etc.). On these lists the IP address is a link to the contributions made by that user, not to the personal user page.

If you want to, you can hide the top user links with the IP address and the discussion page, so that when an unregistered user browses the site this information is not shown at the top. You can also disable the links to the talk pages of anonymous users in the lists with page edits.

Remove the IP address and Talk Page Link from the Header

If you don't want the IP address and the link to the talk page of the anonymous user to be shown in the header of the site, you have to disable the option $wgShowIPinHeader by adding the following on a new line at the end of the LocalSettings.php file of your MediaWiki:

$wgShowIPinHeader = false;

In case you want to enable it again, either delete the line, set it to true, or comment it out by placing the symbol # in front of it.

One thing to keep in mind is that if you set the option $wgUseFileCache to true (it's set to false by default), then this will automatically set $wgShowIPinHeader to false, no matter how it's configured in LocalSettings.php.

Remove Links to Talk Pages of Anonymous Users

To hide all links to talk pages of anonymous users on the lists with page edits (e.g. page histories, Recent changes page), add the following on a new line at the end of LocalSettings.php:

$wgDisableAnonTalk = true;

Note that this option doesn't affect the user links in the header of the site; they are only managed with the option $wgShowIPinHeader.

If you haven't edited the LocalSettings.php file so far and you don't know where it is, you can find it in the root MediaWiki directory on your MediaWiki hosting account. Assuming the application is installed directly in the public_html directory on the account, the path to the file on the account with respect to that directory will be public_html/LocalSettings.php. HostKnox customers can use the file manager of the Pixie control panel to view and edit files. A different way to do it is to download the file on your local computer, edit it with a text editor (e.g. Notepad++) and upload it back replacing the old file.

Was this answer helpful?

 Print this Article

Also Read