Skip to content

Instantly share code, notes, and snippets.

@gzalinski
Created September 13, 2021 13:13
Show Gist options
  • Save gzalinski/3c255ab8888de328552ef19b37dc9cc3 to your computer and use it in GitHub Desktop.
Save gzalinski/3c255ab8888de328552ef19b37dc9cc3 to your computer and use it in GitHub Desktop.
SQL Delete Post Type
//Delete all POSTS META
DELETE
FROM `wp_postmeta`
WHERE post_id in (SELECT id
FROM `wp_posts`
WHERE `post_type` = 'post' )
//Delete all POSTS
DELETE FROM `wp_posts`
WHERE `post_type` = 'post'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment