Summary: How to remove a page's history
(original author: Pm
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.
- 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)
- 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
User notes +2: If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.