Recent Changes - Search:




Summary: How to remove a page's history
Discussion: ExpireDiff-Talk
Categories: Administration

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 0).


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.

See Also


  • Pm, 2004-12-18
  • Klonk, 2005-04-14, Added function ExpireDiffAll
  • Klonk, 2005-08-10, Updated to add the action with help of $HandleActions
  • Klonk, 2005-08-24, Fixed bug introduced with last change
  • 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


See discussion at ExpireDiff-Talk

Edit - History - Print - Recent Changes - Search
Page last modified on September 03, 2012, at 07:52 AM