Title: mysql query
Last modified: August 19, 2016

---

# mysql query

 *  [msky](https://wordpress.org/support/users/msky/)
 * (@msky)
 * [16 years, 10 months ago](https://wordpress.org/support/topic/mysql-query/)
 * This should be simple, but I don’t get sql queries
 * Yesterday I updated a site with a thousand posts. After the update, the posts
   all disappeared — from the blog, and even worse, from the admin edit post page.
 * I could still see all the posts in phpAdmin, just not anywhere in wordpress.
 * Finally figured out that during the update all of the posts lost their Publish
   status. When I switch a Post status to ‘publish’ then it shows up fine and everything
   is working.
 * Now i just need a sql quewry that will do this for all 1000+ posts at once, rather
   than me having to do one at a time.
 * Here’s the SQL that does it for one:
 * UPDATE `yale20`.`wp_posts` SET `post_status` = ‘publish’ WHERE `wp_posts`.`ID`
   =4 LIMIT 1 ;
 * How do I say:
 * WHERE `wp_posts`.`ID` =
 * and get all of them?
 * thanks

Viewing 1 replies (of 1 total)

 *  Thread Starter [msky](https://wordpress.org/support/users/msky/)
 * (@msky)
 * [16 years, 10 months ago](https://wordpress.org/support/topic/mysql-query/#post-1085522)
 * Easy:
 * UPDATE yale20.wp_posts SET post_status = ‘publish’ ;

Viewing 1 replies (of 1 total)

The topic ‘mysql query’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [msky](https://wordpress.org/support/users/msky/)
 * Last activity: [16 years, 10 months ago](https://wordpress.org/support/topic/mysql-query/#post-1085522)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
