[MediaWiki-l] deleteOldRevisions.php is an accident waiting to happen

Jean Valjean jeanvaljean2718 at gmail.com
Sat Jul 1 06:41:00 UTC 2017


I came up with something a little safer and easier for those who just want
to delete old revisions from one namespace: https://www.mediawiki.org/
wiki/User:KryptoKronic/deleteOldRevisions.php

The output looks like this:

$ php deleteOldRevisions.php --delete 4

Delete old revisions

Limiting to namespaces 4
Limiting to page IDs 4,2
Limiting to page titles Project:Bar,Project:Foo
Searching for active revisions...done.
Searching for inactive revisions...done.
3 old revisions found.
Abort with control-c in the next five seconds (skip this countdown with
--quick) ... 0
Deleting...done.
Searching for active text records in revisions table...done.
Searching for active text records in archive table...done.
Searching for inactive text records...done.
3 inactive items found.
Deleting...done.


More information about the MediaWiki-l mailing list