Manual:deleteRevision.php

From MediaWiki.org
Jump to: navigation, search
MediaWiki File: deleteRevision.php
Location: /maintenance/
Source code:

HEAD1.19.0rc1
1.19.01.18.3

Classes: None

deleteRevision.php is a maintenance script located in the maintenance directory that can be used to delete one or more revisions by moving them to the archive table. This makes the revision disappear from the public version of the wiki. If this achieves the expected result, the Manual:DeleteArchivedRevisions.php script can be used to completely remove the revision from the database.

To find the ID of the revision to delete, look at the URL for each date on the history page. It will look something like http://yourwiki/index.php?title=Page_Title&oldid=1234. The revision ID is the oldid, 1234 in this example. This revision can be deleted like so:

php maintenance/deleteRevision.php 1234

[edit] Deleting the current page revision

If a page's current revision is deleted, the edit page will return an error indicating the latest revision cannot be found, and the page content will still reflect the old (deleted) revision.

There is probably a better way to fix this, but for me setting the page_latest value to zero in the database (UPDATE `page` SET `page_latest` = '0' WHERE `page_id` = 123, change 123 to the page ID) then running Manual:AttachLatest.php updated the latest revision number and page content, getting everything back to normal.

[edit] See also

Language: English
Personal tools
Namespaces

Variants
Actions
Navigation
Support
Download
Development
Communication
Print/export
Toolbox