Knowledgebase

How to change the period for which changes are kept on the Recent changes list in MediaWiki

The Recent changes page in MediaWiki shows a list of the most recent changes on the site (page edits, user changes, etc.). By default, the page that opens shows the changes from the last seven days (or the last 50 changes), but you can expand the list using the options at the top. A registered user can also select from there preferences for how many days back the list should display changes (Preferences button>Recent changes tab). The list however has some limits in terms of the time period for which changes are stored. By default, this is set to 91 days. So all changes that are older than 91 days are purged from the Recent changes list. If you want to, you can increase or decrease that period.

This is done by adding the option for the maximum age of the recent changes list to the LocalSettings.php file of your MediaWiki and setting that option to the desired value (in seconds). The option is $wgRCMaxAge. So, for example, if you add the following line to LocalSettings.php:

$wgRCMaxAge = 31536000;

each change will be stored in the recent changes list for 31536000 seconds, the equivalent of 365 days or 1 year.

Note however that the maximum time that you set shouldn't be less than the default number of days that are set for the list (7 days). By default, when users open the Recent changes page, the changes from the last 7 days are displayed (as we mentioned they can expand the list). So if you haven't changed that default number of days, the maximum time that you set for changes to be stored shouldn't be set to fewer than 7 days. Otherwise, this will break the page that displays the preference options of user accounts.

The LocalSettings.php file that you have to edit to change the maximum age of the recent changes list is located in the root MediaWiki folder on your hosting account. If, for instance, the application is installed in the public_html directory on your MediaWiki hosting account, then the path to the file on the account will be public_html/LocalSettings.php. HostKnox customers can view and edit files on their accounts with the File manager of the Pixie control panel. An alternative is to download it on your local computer, edit it with a text editor (e.g. Notepad) and upload it back. Files can also be edited via SSH.

For basic information on the Recent changes page check out the section on the Recent changes page in the tutorial on how to track and patrol edits.

Other articles related to the Recent changes page:

Was this answer helpful?

 Print this Article

Also Read