Currently I am using a simple Wordpress plugin in order to prevent duplicate post entries. It is a simple Wordpress function:
$prefix = $wpdb->prefix;
$wpdb->query("DELETE bad_rows . * FROM ".$prefix."posts AS bad_rows INNER JOIN (
SELECT ".$prefix."posts.post_title, MAX( ".$prefix."[url removed, login to view] ) AS max_id
GROUP BY post_title
HAVING COUNT( * ) >1
) AS good_rows ON ( good_rows.post_title = bad_rows.post_title
AND good_rows.max_id <> [url removed, login to view] )");
This plugin is used on an autoblog and deletes the old post with the same title, keeping the new one instead.
But this doesn't delete the post-historie and also don't delete the attachments.
You have to rewrite the plugin so it uses wordpress functions and also delete all historie entries and all attachements.
Only a very small change.
I want to adapt this plugin, to be able to delete the the attached images of the old post, not only the database entry. So, the old post should be deleted completely, including the attached images. That's it...