Bulk Edit of the Status Field for all Posts in WordPress Database

Bulk Edit of the Status Field for all Posts in WordPress Database

If you need to change the access and privacy of WordPress posts in one quick move, here’s how you can do it through the database. Open phpMyAdmin and run this query:

{code type=html}
UPDATE wp_posts SET post_status = ‘STATUS’ WHERE post_status != ‘static’;
{/code}

Change ‘STATUS’ to either draft, private, or publish.

If you want to do this on an author-specific basis, run this one:

{code type=php}
UPDATE wp_posts SET post_status=’STATUS’ WHERE post_author=’NUMBER’;
{/code}

Replace ‘NUMBER’ with the post author’s ID and you’ll be able to bulk update the status for all posts associated with that one author.