Manual:DeleteOldRevisions.php

Details
deleteOldRevisions.php file is a maint-scripts>Special:MyLanguage/Manual:Maintenance scripts|maintenance script to delete old (non-current) revisions from the revision table in the database.

The script works on old, non-deleted revisions (which are stored in the  table).

The script deletes all old, non-deleted revisions from the revision table and then invokes  to purge the text records which no revision links to.

This can be useful for reduce>Special:MyLanguage/Manual:Reduce size of the database|reducing the size of the database but it does mean you lose the ability to restore the according revisions.

This script does not remove any deleted revisions (which are stored in the  table)!

Use the maintenance script  to delete all rows from the archive table.

This script deletes page histories.

If you run a GFDL licensed wiki you need to be aware that the GFDL requires you to keep the page histories.

Usage
Deleting all old revisions:

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

Options

 * : Actually performs the deletion. Otherwise the script will only display the number of items that it can delete.


 * : Performs the deletion only on the page ids (numbers) given as unnamed arguments.

Example
 [/] # find / -name php /mnt/ext/opt/apache/bin/php

[/] # find. -name deleteOldRevisions.php [/] # php ./maintenance/deleteOldRevisions.php --delete