On this page
Many people look for the WordPress media trash after deleting an image, and then cannot find it. There is a reason. On a default WordPress install, the media trash is turned off. Deleting a file removes it for good. This guide shows you how to turn the trash on, how to restore items from it, and what to do when you already deleted something without it.

Is the media trash on by default?
No. WordPress has a trash for posts and pages, but media uploads are deleted permanently unless you enable the media trash. When you click “Delete permanently” on an image, WordPress removes the database record and the files from the uploads folder.
That is why many guides about restoring an image from the trash do not match what you see. The “Trash” link in the Media Library only appears when the setting is on and at least one item has been trashed.
How to turn on the WordPress media trash
You enable it with a single line in your wp-config.php file. Take a backup first, and edit carefully.
- Connect by FTP or open your host’s file manager.
- Open
wp-config.phpin the root folder. - Add this line above the text “That’s all, stop editing”:
define( 'MEDIA_TRASH', true );- Save the file and reload your dashboard.
The WordPress developer documentation on editing wp-config.php explains the file in more detail.
From now on, deleted media moves to the trash first. WordPress empties the trash on a schedule that you can change with another setting, EMPTY_TRASH_DAYS.
How to restore media from the trash
Once the trash is on and you have deleted an item, do this.
- Go to Media > Library and switch to the list view.
- Click the Trash link above the table.
- Hover over the item and click Restore, or select several and use the bulk action.
The image returns to the library with its original title, alt text, and links, so the pages that use it work again.
What if the trash was off when you deleted the image?
If the setting was off, there is nothing in the trash to restore. The database record is gone. But the file may still be on your server. Check wp-content/uploads through FTP, and look for the file name.
- File found: a recovery plugin can re-register it. Media Library Recovery Free recovers up to 10 images at a time and rebuilds the library entry from the file.
- File not found: restore from a backup or a host snapshot.
Our guide to restoring deleted images in WordPress in 3 ways compares these routes in detail.
What the trash does not protect
Be careful with false confidence. Even with the trash on, you can lose files in these cases:
- You click “Delete permanently” from the trash.
- The trash empties itself after the set number of days.
- A plugin or script deletes files directly from the server.
- A migration or restore overwrites the uploads folder.
For these cases, a separate uploads backup is your safety net. See our help article on backing up your uploads folder.
Pro tip: delete less, hide more
Instead of deleting images you may need again, keep a folder of “retired” files and remove them from pages only. Disk space is cheap compared to the time it takes to recover a lost file.
If you manage a big library or a store with many product photos, Media Library Recovery Pro also recovers videos, audio, and documents without a file limit.
WordPress media trash: common questions
Does the WordPress media trash use extra disk space?
Yes. Trashed files stay on the server until the trash is emptied, so very large libraries use more space.
How long are items kept in the trash?
By default WordPress keeps trashed items for 30 days, and you can change that with the EMPTY_TRASH_DAYS setting.
Does the trash also keep resized copies?
The trash keeps the original record. When you restore the item, WordPress shows it again, and any missing sizes can be rebuilt with a thumbnail tool.
Do I need a plugin if I use the trash?
The trash is a good first layer. A backup and a recovery plugin cover the cases the trash cannot, such as permanent deletion or a database restore.
Conclusion
The WordPress media trash is a handy safety net, but it is off by default. Turn it on with one line in wp-config.php, restore items from the Trash link in the library, and keep a backup for everything else. If an image is already gone from the library but still on the server, a recovery plugin can bring it back.
Ready to check what is still on your server? Try the free plugin today.

