Title: My Sql Delete Before Certain Date
Last modified: August 20, 2016

---

# My Sql Delete Before Certain Date

 *  Resolved [diragusa](https://wordpress.org/support/users/diragusa/)
 * (@diragusa)
 * [14 years, 5 months ago](https://wordpress.org/support/topic/my-sql-delete-before-certain-date/)
 * I recently saw this query for deleting posts from a certain date.
 * _I got this to work. This will delete posts older than 6 months from the current
   time and date. Obviously you can change the interval to whatever you need._
 * delete from wp_posts where post_date < DATE_SUB(NOW(), INTERVAL 6 MONTH)
 * Does this do what it says? im looking for something that deletes any post before
   the present day. and it would do that everyday prferably.
    Im very limited in
   php, and mysql. but how would you implement this. and as such will this only 
   run once?

The topic ‘My Sql Delete Before Certain Date’ is closed to new replies.

## Tags

 * [delete](https://wordpress.org/support/topic-tag/delete/)
 * [MySQL](https://wordpress.org/support/topic-tag/mysql/)
 * [wp_post](https://wordpress.org/support/topic-tag/wp_post/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [diragusa](https://wordpress.org/support/users/diragusa/)
 * Last activity: [14 years, 5 months ago](https://wordpress.org/support/topic/my-sql-delete-before-certain-date/)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
