Eventually I will go though the database and delete all those posts.

Please correct me if I'm wrong but, considering UBB's db design, can't this be done by performing a SQL query involving a few JOINs or by creating a small script if you want to avoid using a SQL query containing JOINs? It would save a lot of time.