Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aaronsummers/f69a62b1eaa3f07383365e863fb4e438 to your computer and use it in GitHub Desktop.
Save aaronsummers/f69a62b1eaa3f07383365e863fb4e438 to your computer and use it in GitHub Desktop.
Bulk update ALL WordPress post statuses in SQL
# Change post_type value if targeting 'page' or a custom post type
# Change ALL posts status from 'publish' to 'draft'
UPDATE wp_posts SET post_status = 'publish' WHERE (post_type = 'post' and post_status = 'draft')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment