Last active
August 29, 2015 13:56
-
-
Save wpsmith/9025786 to your computer and use it in GitHub Desktop.
SQL: Batch delete old posts. This example is set to delete any post which is older than 600 days.
This file contains 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 = 'post' AND DATEDIFF(NOW(), post_date) > 600 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment