Advanced tricks

How do I batch delete items older than a certain date?

Scenario:
"I would like to delete all items older than a certain date. Is there a quick way of doing this?"

Solution:
You will need to run the following MySQL query through the phpMyAdmin interface:

DELETE FROM `nucleus_item` WHERE `itime` < 'YYYY-MM-DD hh:mm:ss';

where YYYY is the year; MM is the month; DD is the day; hh is the hour; mm is the minute; and ss is the second.

WARNING: PLEASE MAKE SURE YOU BACKUP YOUR DATABASE BEFORE RUNNING THIS MYSQL QUERY!! ANY ITEMS THAT YOU DELETE THIS WAY CANNOT BE RECOVERED!!

Original forum thread (thanks, ftruscot!):
http://forum.nucleuscms.org/viewtopic.php?t=13383

section: Advanced tricks | submitted by Leng on 2006.Dec.06 | 2825 views

item rate
This answer was not rated yet.

Please tell us how useful this answer was to you (0 = useless, 10 = very very helpful):

10