Change the Status of all WordPress Posts

We recently worked on a project where the client had a blog they wanted reskinned to match a new site design.  During development, they decided to start this blog from scratch with all new posts, but they still wanted to keep the older posts just in case they needed to reference them at some point.  This can be done fairly easily via the database, and here it the SQL to do it:

update wp_posts set post_status = replace(post_status, 'publish', 'draft');
update wp_posts set post_status = replace(post_status, 'inherit', 'draft');

Comments are closed.