Last active
April 12, 2023 08:43
-
-
Save Nolwennig/e09d08a2085b4a829219ee63b084abd3 to your computer and use it in GitHub Desktop.
This query deletes all post revisions that were modified more than 30 days ago from the current date. Note that this query can potentially delete a large number of revisions, so be sure to back up your data before running it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DELETE FROM wp_posts | |
WHERE post_type = 'revision' | |
AND post_modified < DATE_SUB(NOW(), INTERVAL 30 DAY); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment