Forums

batch delete posts based upon category and date (1 post)

  1. cosmicjellybaby
    Member
    Posted 5 months ago #

    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...

Reply

You must log in to post.

About this Topic

  • RSS feed for this topic
  • Started 5 months ago by cosmicjellybaby
  • This topic is not resolved
  • WordPress version: 3.3