These are MySQL statements to bulk delete all WordPress attachments of a specified modified date in the WordPress database. Both steps are needed to remove not only the attachments, but also the postmeta which is attached to the parent post. This is a clean way to get rid of attachments without leaving behind dangling postmeta.
In this example, I use a wildcard (LIKE ‘2014-%’) for the date. This example will delete all attachments that have the year 2014 as the date. You can change the ‘2014-%’ in both steps to meet your needs.
DELETE FROM wp_postmeta WHERE post_id IN ( SELECT id FROM wp_posts WHERE post_modified LIKE '2014-%' AND post_type = 'attachment' )
DELETE FROM wp_posts WHERE post_modified LIKE '2014-%' AND post_type = 'attachment'