Deleting Old Posts SQL Queries
-
Im just wondering in detail how to implement this code:
DELETE FROM
wp_posts
WHEREpost_type
= ‘post’
AND DATEDIFF(NOW(),post_date
) > 2Will this delete anything before two days ago? or will it delete just the day before and leave all the other posts before that.
Say i have 5 posts dated monday. tuesday, wendsday, thursday, friday.
but today is thursday, will the code above just delete wendsday and tuesday. but keep monday. or will it delete everything before thursday and keep friday as well.I also have multiple directories, will i have to add to the code.
DELETE FROMwp_posts
, wp_post_2, wp_posts_3 etc etc.Or will just wp_post find all the posts in all the directories of the multisite.
Any insight would be great.
- The topic ‘Deleting Old Posts SQL Queries’ is closed to new replies.