mysql - How Do I Delete All Posts Over 400 Days Old -


I have tried the following phpMyAdmin query in the attempt to delete all posts from database category 378 of more than 400 old days. /p>

  Delete one, b, c, d from wp_posts Add a left wp_term_relationships b (a.ID = b.object_id) on wp_postmeta c (a.ID = c.post_id) join left Wp_term_taxonomy d ON (d.term_taxonomy_id = b.term_taxonomy_id) LEFT JOIN wp_terms and ON (e.term_id = d.term_id) WHERE e.term_id = 378 and DATEDIFF (now (), a.post_date) & gt; 400   

Instead, the query has removed the entire category and all its posts. How do I create that phpMyAdmin query, which will delete any posts that are 400 days old from that specific category?

I have a database backup.

try

like this:

  where date & lt ; UNIX_TIMESTAMP (DATE_SUB (NOW (), INTERVAL 400 days))    

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -