@Piet的答案是最好的,但有些sql代码可以删除所有超过28天的旧版本:
DELETE a,b,c FROM wp_posts a
LEFT JOIN wp_term_relationships b ON (a.ID=b.object_id)
LEFT JOIN wp_postmeta c ON (a.ID=c.post_id)
WHERE a.post_type=\'revision\'
AND a.post_date < DATE_ADD(NOW(), INTERVAL -28 DAY);
SQL和PHP代码(用于不同于“WP\\u”前缀的WP\\u)
iworks_revisions.zip