This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Using FTP/SSH & Database | |
This method allows you to delete all items in your media library at once. Be sure to backup your database prior to doing this. | |
Each file in your media library has one row in the `wp_posts` table and two rows in the `wp_postmeta` table. Learn more about how WordPress stores media library entries in the database here. You can delete them all in bulk using these commands: | |
DELETE FROM `wp_posts` WHERE `post_type` = "attachment"; | |
DELETE FROM `wp_postmeta` WHERE `meta_key` = "_wp_attached_file"; | |
DELETE FROM `wp_postmeta` WHERE `meta_key` = "_wp_attachment_metadata"; |