Title: SQL to delete posts
Last modified: August 19, 2016

---

# SQL to delete posts

 *  [depalmal](https://wordpress.org/support/users/depalmal/)
 * (@depalmal)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/sql-to-delete-posts/)
 * I am looking for a SQL statement that will help clean my database out of all 
   posts that are unpublished (I have thousands of them now due to newsfeeds)
 * I think there are some relational tables between posts and other things, so I
   want to make sure the DB is clean and easier to manage.

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [stvwlf](https://wordpress.org/support/users/stvwlf/)
 * (@stvwlf)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/sql-to-delete-posts/#post-1243224)
 * in WP 2.8 you can do this in a reasonable amount of time in the WordPress admin
   area.
 * 1) go to edit posts list page
    2) Near the top click on Draft 3) near the top
   right click on Screen options, and set Posts per Page to 1000 – close screen 
   options. 4)at the top on the grey line, at the left, click the checkbox next 
   to the word Posts – this highlights every post on the page 5) in the Bulk Actions
   pulldown, set it to Delete 6) Click the Apply button That deletes 1000 posts 
   all at once. Repeat the process until they are all deleted.
 *  [Hubert Nguyen](https://wordpress.org/support/users/hubertnguyen/)
 * (@hubertnguyen)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/sql-to-delete-posts/#post-1243458)
 * Depending on one’s server you might get a “Request-URI Too Large” error. I’ve
   been looking into this, and I think that I’ll go to MySQL and delete the content
   of the wp_postmeta and wp_posts tables

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘SQL to delete posts’ is closed to new replies.

## Tags

 * [sql](https://wordpress.org/support/topic-tag/sql/)

 * 2 replies
 * 3 participants
 * Last reply from: [Hubert Nguyen](https://wordpress.org/support/users/hubertnguyen/)
 * Last activity: [15 years, 10 months ago](https://wordpress.org/support/topic/sql-to-delete-posts/#post-1243458)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
