Last active
October 3, 2019 04:15
-
-
Save kobaatsu/b9114044c78ff765520301de9e9a18da to your computer and use it in GitHub Desktop.
[指定した日付より古いものを削除する] https://fukumoto-tech.serveblog.net/wiki/index.php?wordpress%E3%81%A7%E6%8C%87%E5%AE%9A%E3%81%97%E3%81%9F%E6%97%A5%E4%BB%98%E3%82%88%E3%82%8A%E5%8F%A4%E3%81%84%E3%82%82%E3%81%AE%E3%82%92%E5%89%8A%E9%99%A4%E3%81%99%E3%82%8BSQL #wordpress
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
# 例2017年01月01日 00時00分00秒より、古い記事を削除 | |
DELETE FROM wp_posts WHERE post_date < '2017-01-01 00:00:00'; | |
# 最小の記事IDを確認し、メモを取る | |
select ID,post_date from wp_posts ORDER BY ID ASC limit 5 ; | |
# wp_postmetaテーブルからのデータ削除(最小の記事IDが140679の場合) | |
DELETE FROM wp_postmeta WHERE post_id < 140679; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment