wordpress delete post revisions older than date "sql" 1

wordpress delete post revisions older than date “sql”

DELETE a,b,c FROM wp_posts a WHERE a.post_type = 'revision' LEFT JOIN wp_term_relationships b ON (a.ID = b.object_id) LEFT JOIN wp_postmeta c ON (a.ID = c.post_id);

Here is what the above code is Doing:
1. It’s deleting all the revisions from the wp_posts table.
2. It’s deleting all the relationships between the revisions and the terms from the wp_term_relationships table.
3. It’s deleting all the relationships between the revisions and the postmeta from the wp_postmeta table.

Similar Posts