Question answered by this recipe
How do I remove a page's history?
The expirediff.phpΔ script adds
?action=expirediff, which removes all of the page revision history information from a wiki page. It requires the user to have edit permissions to the page, and handles locking. It also creates a backup copy of the page with the page revisions intact (same as if someone had requested to delete a page).
In addition, one can add the
keepdays=nn parameter, which says to keep any page history within the past nn days. For example,
?action=expirediff&keepdays=7 will remove any page history older than seven days. By default
keepdays is zero, which expires the entire page history.
You can also remove the history of all pages or only the history of a specified group. It is possible to specify some options when calling the function
ExpireDiffAll from your
config.php. The first parameter specifies the group whose files history should be removed. Default is
'' which means all files. The second parameter specifies whether backups should be created,
0 means overwrite existing files (defaults to
1). Be careful with this option! The third parameter specifies which histories should be kept, see
keepdays above (defaults to
means: Remove the history older than 5 days from all files within the Group
Test and overwrite existing files (no backup).
To install this script, simply copy it into your cookbook/ subdirectory, and then add the line
to your local/config.php file.
- 20170928, Fix undefined $keepdays integer value 0 when not set (Petko)
- 20150821, Add license block and $RecipeInfo tag (Petko)
- 20050824, Fixed bug introduced with last change (Klonk)
- 20050810, Updated to add the action with help of
- 20050414, Added function
- 20041218, original release (Pm)
- PageHistory and EditVariables#DiffKeepDays - You can set the variable
$DiffKeepDaysto automatically drop page history older than a number of days.
- Limit diffs per page - a recipe to set a maximum number of diff entries displayed on the history page.
- See Release notes for contributions to the source code.
- Hagan, Suggestion to fix password protection.
- Dfaure, Suggestion to add ExpireDiff to end of history page.
- Ian MacGregor, Suggestion to style (via CSS) ExpireDiff on history page.
- Petko is the maintainer of this recipe.
See discussion at ExpireDiff-Talk