View Full Version : query to remove all PMs older than X days?
z0diac
01-20-2010, 04:09 AM
Does anyone know if it's possible to remove all PMs that are older than 'X' days via an sql query ? I can run the 'update counters' thing after.. I just want to remove msgs that a spammer sent to my entire memberlist.
bebo2004
01-21-2010, 03:34 AM
if u want to delete all Pms to all u memberlist
run query
TRUNCATE `pm`;
then
TRUNCATE `pmreceipt`;
then
TRUNCATE `pmtext`;
then
UPDATE `user` SET `pmtotal` = 0, `pmunread` = 0;
but u must be to close ur forum befor run the query
take care
z0diac
01-21-2010, 04:31 AM
Thank you! I'll forward your msg to the person coding it for me. It would have been nice to have vB build this into their releases the same way they have public post pruning. :o
CarlitoBrigante
01-21-2010, 04:55 AM
Be careful, those queries will delete all PMs!
If I remember correctly, using the pmtext.dateline field should be enough to get the date of the PM. Build a query on that, and run the cronjob frequently enough to avoid a too intensive process.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.