Title: batch delete posts based upon category and date
Last modified: August 20, 2016

---

# batch delete posts based upon category and date

 *  [cosmicjellybaby](https://wordpress.org/support/users/cosmicjellybaby/)
 * (@cosmicjellybaby)
 * [14 years, 5 months ago](https://wordpress.org/support/topic/batch-delete-posts-based-upon-category-and-date/)
 * Hi, I’ve been trying to delete some of my posts based upon their category and
   the date published. I have found an SQL query on this forum:
 *     ```
       SELECT a,b,c
       FROM wp_posts a
       LEFT JOIN wp_term_relationships b ON ( a.ID = b.object_id)
       LEFT JOIN wp_postmeta c ON ( a.ID = c.post_id )
       LEFT JOIN wp_term_taxonomy d ON ( b.term_taxonomy_id = d.term_taxonomy_id)
       WHERE a.post_date < '2010-01-01 00:00:00'
       AND d.taxonomy = 'category'
       AND d.term_id = x;
       ```
   
 * but it gives me an SQL error message
 * > #1054 – Unknown column ‘a’ in ‘field list’
 * Obviously, I have used the correct category value.
 * Any help gratefully received…

The topic ‘batch delete posts based upon category and date’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [cosmicjellybaby](https://wordpress.org/support/users/cosmicjellybaby/)
 * Last activity: [14 years, 5 months ago](https://wordpress.org/support/topic/batch-delete-posts-based-upon-category-and-date/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
