How to Mass Delete Images from Media Library

I need your help. I am trying to mass delete attachments from a custom post type (‘book’) using a sql query. I found this snippet on the wordpress form: WordPress.org

I tested it on my local computer, and it removes all of the attachments from my media library. Now, I would like to have your help in setting the query so that it will only target attachments(featured image and thumbnail) from my custom post type ‘book’.

Thanks

Read more here: How to Mass Delete Images from Media Library

Leave a Reply

Your email address will not be published. Required fields are marked *