Set WordPress to Automatically Empty the Trash

Set WordPress to Automatically Empty the Trash

I found this simple, handy tip over at wprecipes.com. You can set the automatic interval at which WordPress must empty the trash by adding this to your wp-config.php file:

FREE EBOOK
Your step-by-step roadmap to a profitable web dev business. From landing more clients to scaling like crazy.

By downloading this ebook I consent to occasionally receive emails from WPMU DEV.
We keep your email 100% private and do not spam.

FREE EBOOK
Plan, build, and launch your next WP site without a hitch. Our checklist makes the process easy and repeatable.

By downloading this ebook I consent to occasionally receive emails from WPMU DEV.
We keep your email 100% private and do not spam.

define('EMPTY_TRASH_DAYS', 10 );

The number 10 refers to how many days between WordPress trash dumps. Set a “Garbage Day” interval that is convenient for you and start saving a little space.