Beginner's Guide for WordPress - Start your WordPress Blog in minutes.
Choosing the Best
WordPress Hosting
How to Easily
Install WordPress
WordPress Plugins
View all Guides

How to Automatically Empty Your WordPress Trash

Last updated on by
Special WordPress Hosting offer for WPBeginner Readers
How to Automatically Empty Your WordPress Trash

In WordPress 2.9, there was a new “Trash” feature added to the core. This feature works just like the recycling bin, so instead of deleting the post permanently, you would send it to the trash. This helped those users who accidently click on Delete button, and it can be any of us. The bad part about this trash feature is that you have to empty the trash regularly. By default the trash empties itself every 30 days. But in this article, we will show you how you can automatically empty your trash daily, weekly, or however many days you want.

All you have to do is open your wp-config.php file. This will is usually located in the same directory where wp-includes is located.

define('EMPTY_TRASH_DAYS', 1 ); //Integer is the amount of days

Change the 1 to 7 or however many days you want. If you don’t like the trash feature at all, then you can always set the number to 0, and get rid of it entirely.

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi. Page maintained by Syed Balkhi.

WPBeginner's Video Icon
Our HD-Quality tutorial videos for WordPress Beginners will teach you how to use WordPress to create and manage your own website in about an hour. Get started now »


  1. kenal says:

    I found this very useful because even after deleting a post, slide or comment. Going to the trash to permanently empty it is always the next step. Makes me more lazy in regards to that which is cool.

  2. Ahmad says:

    awesome i got tired to trash topic and comments every day thanks for the awesome solution

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.