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:

1
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.

Comments (6)

  1. That is a very handy directive. But I’ve never used this before. What is the default value for EMPTY_TRASH_DAYS btw? I’m sure WP does some cleaning up on it’s own by default.

Participate