In WordPress, trash is the location where deleted posts, pages and comments are stored temporarily. It is similar to the recycle bin or trash on your computer.
If you deleted an item accidentally, then you can easily recover it from the trash. Once an item has been in the trash for 30 days, it will be permanently deleted.
The trash feature was added to WordPress 2.9.
Only users with the proper permission level have the ability to delete posts, pages and comments. By default, users need to have the role of administrator or editor.
Note that there is no trash for media files. Once you delete a media file, it is deleted permanently, so you should delete it with care.
How to Use Trash in WordPress
You can access the trash for pages, posts, and comments on your WordPress website by navigating to:
- Posts » All Posts for the Post admin screen
- Pages » All Pages for the Page admin screen
- Comments » All Comments for the Comments admin screen
Once you are on any of these pages, you will see a link to ‘Trash’ at the top of the page. Simply click on the link to view the items in the trash.
You can choose to restore or permanently delete any post, page, or comment by clicking on the ‘Restore’ or ‘Delete Permanently’ links under any item.
You can learn more about restoring deleted items in our guide on how to recover and restore deleted pages in WordPress.
How to Empty Trash in WordPress
You can permanently delete certain posts, pages, and comments while leaving the rest of the items in the trash. Simply view the trash for posts, pages, or comments as described above.
Next, click the checkbox next to any items you wish to remove from the trash. Now, click ‘Bulk Actions’ from the drop down menu and select ‘Delete Permanently’.
Finally, click ‘Apply’ to complete the deletion process.
You can also permanently delete all trash items at once. Just go to the post, page, or comment trash screens and then click the ‘Empty Trash’ button at the top or bottom of the screen.
Be aware that when you click the ‘Empty Trash’ button, that trash container will be completely emptied. All items will be permanently deleted and you will not be able to restore them.
You can learn about two other ways to delete multiple posts, pages, attachments, users and meta fields in our article on how to bulk delete WordPress posts.
You can also check our guide on how to easily bulk delete all WordPress comments.
Changing How Often Trash Is Emptied
We mentioned that WordPress permanently deletes any items in the trash that have been there for 30 days. Some users prefer the trash to be emptied more or less frequently. Others prefer it not to be emptied automatically at all.
It’s possible to change how often the WordPress trash is emptied by using a plugin or code snippet. For example, the Change Empty Trash Time plugin can empty the trash after a specified number of days, or bypass the trash altogether.
For more information, refer to our guides on how to automatically empty your WordPress trash and how to limit or disable automatic empty trash in WordPress.
We hope this article helped you learn more about trash in WordPress. You may also want to see our Additional Reading list below for related articles on useful WordPress tips, tricks, and ideas.
If you liked this guide, then please consider subscribing to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.