Created
October 24, 2017 18:42
-
-
Save micjamking/000f949da7bea0d308450301c1aa88d8 to your computer and use it in GitHub Desktop.
Bulk update ALL WordPress post statuses in SQL
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
# 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') |
UPDATE wp_posts
SET post_date="2018-07-21 01:16:30" WHERE post_status="publish" AND post_type="post"
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey Mike, if I wanted to update the posts date, to latest or some random, what would be SQL command for that ?
Peace,