Jump to: navigation, search

Other languages:
Deutsch • ‎English • ‎español • ‎français • ‎italiano • ‎日本語 • ‎polski • ‎português • ‎português do Brasil • ‎русский


deleteOldRevisions.php file is a maintenance script to delete all old (non-current) revisions from the revision table in the database. The script works on old, non-deleted revisions (which are stored in the revisionManual:revision table table). The script deletes all old, non-deleted revisions from the revision table and then invokes purgeOldText.phpManual:purgeOldText.php to purge the text records which no revision links to. This can be useful for reducing the size of the database but it does mean you lose the ability to restore the according revisions.

The script can be limited not to remove old revisions of all pages, but to only remove old revisions of specific pages.

This script does not remove any deleted revisions (which are stored in the archiveManual:archive table table)! Use the maintenance script deleteArchivedRevisions.phpManual:DeleteArchivedRevisions.php to delete all rows from the archive table.

This script deletes page histories. You need to be aware that there are licenses, which require you to keep the page histories. E.g. you may not delete old revisions, if you run a GFDL licensed wiki.


Deleting all old revisions:

php deleteOldRevisions.php --delete

Deleting all old revisions from specific pages (page id 1, 2, 15 and 38):

php deleteOldRevisions.php --delete 1 2 15 38


Option/Parameter Description
list of page ids Performs the deletion only on the page ids (numbers) given as unnamed arguments.
--delete Actually performs the deletion. Otherwise the script will only display the number of items that it can delete.

See also[edit]