Support » Fixing WordPress » BUG: Bulk image delete crashing server

  • It appears as though when bulk deleting images, too many DB calls and server calls are generated and end up overloading a server’s resources.

    On my SSD based Linux VPS server with 2xCPU and 4GB of ram, any deletion of more than 15 images causes the server to crash and services to restart.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    Attachments, like images, are stored as posts. They have data, metadata, files associated with them, various sizes, etc. Deleting anything in WordPress is a fairly expensive operation indeed. Additionally, WordPress first moves things to the “trash” state before actually deleting them 30 days later.

    So yes, any bulk operation is going to be slow. If you delete 10 things, then that’s like deleting those 10 things one at a time. It doesn’t really have a “bulk” feature. It’s only “bulk” in the interface, it still deletes them individually.

    My advice would be to delete things in smaller batches, or if you really need to clean up a lot of stuff, look for a plugin to make that task easier and more optimized. There’s a few plugins that might help you out:

    https://wordpress.org/plugins/search/bulk+delete/

    I am going crazy trying to figure out how to bulk delete images without having the server crash. I can only delete about 20-30 images at a time or risk crashing the website. I have 8000+ images to delete.

    My web-host says its caused by: WordPress Heartbeat and Heavy admin-ajax.php Usage

    Anyone know about this and can help?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘BUG: Bulk image delete crashing server’ is closed to new replies.