Set or Update Multiple Posts to scheduled or publish

By | 5 January, 2015

How to change multiple post status from ‘draft’ to ‘publish’

I am writing this post as I had managed to create loads of ‘draft’ posts (2,383 to be exact) that I wanted to set to ‘publish’. I am not a software engineer of php/sql expert just a simple blogger.

The normal method for doing this, for less than 100 posts, is to do the following;

  1. In Admin mode go to “All Posts”
  2. Under the “Howdy, admin” (logout icon) you will see two boxes (Screen Options | Help) , click the down arrow by the side of the “Screen Options”
  3. “Show on screen” will display some tick box options, one of the options is a list box “posts”. Update this to a maximum of 100 (50 is recommended) you can enter any number you like but you will probably find the page/server times out with an error or your hosting resources are exceeded. Click apply!
  4. Next click on “draft”to filter only the draft posts
  5. Select/tick the “select all” box on the left of the screen – this will add a tick to the first 50 or so draft posts
  6. On the left of the screen is a list box (Bulk Actions | Edit | Move to Trash) – Select “Edit”.
  7. This will display a “Bulk Edit” options box – Change the Status list box to “Published” – Click Update! Please be PATIENT this may take a while to process …

The alternate method for more than 100 posts is to do the following;

Please note: This is not for the faint hearted editing the back office sql database can cause significant site issues if you make a mistake.

PLEASE BACK UP YOU DATABASE BEFORE YOU START

  1.  Login to you cPanel (Control Panel), scroll down to “Databases” and click on “phpMyAdmin”. This will launch a new tab (something like “localhost | phpMyAdmin 4.1.8″.
  2. On the left hand sidebar select the relevant database to the WordPress installation (website) you want to edit. You would have named this during the WordPress installation. This will display a table structure with a range of tabs at the top.
  3. On the left hand sidebar select “wp_posts” (note that the “wp_” prefix is the WordPress standard you may have chosen to customise the table prefixes with your own convention.
  4. Select the “SQL” tab. This will display an empty dialogue box, note if the dialogue box already contains scripts – delete these so the box is clear or click the clear button on the bottom middle of the dialogue box.
  5. Paste the following script below exactly as shown below and click the “Go” button – bottom right:

UPDATE wp_posts SET post_status=’publish’ WHERE post_status = ‘draft’

That’s it – you should now get a message something like; ” 2838 rows affected. (Query took 0.1344 sec)

I hope this was of help to anybody out there as it took me a while to work out how to do this despite hours of google searches.

 

Regards Keith