Drupal: Delete orphaned node revisions via MySQL

Just a little snippet to delete orphaned node revisions in Drupal (6/7). Take care, if you have other important dependencies in your database.
The table names must eventually be changed according to your selected table prefix!

  1. DELETE FROM node_revisions WHERE node_revisions.vid NOT IN (SELECT n.vid FROM node n)

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.

More information about formatting options