
On your WordPress blog, when an item like a post or comment is deleted, it goes in Trash instead of being permanently removed. Here is a super simple code snippet to tell WordPress to automatically empty the trash everydays.

On your WordPress blog, when an item like a post or comment is deleted, it goes in Trash instead of being permanently removed. Here is a super simple code snippet to tell WordPress to automatically empty the trash everydays.
Simply open your wp-config.php file (Located at the root of your WordPress install) and add the following line of code:
define('EMPTY_TRASH_DAYS', 1);
Replace 1 by X to empty spam comments automatically every X days. That's simple as that!
6 Responses
Its good to trash post automatically
Thanks for this post! I really wanted to permanently delete the post and comments. I will use this trick for sure
I assume you mean wp-config.php ?
“I assume you mean wp-config.php ? ”
i was looking for that, nice post and good tips thanks for sharing
like you mentioned
define(‘EMPTY_TRASH_DAYS’, 1);
do you think
define(‘EMPTY_SPAM_DAYS’, 1);
will work to automatically clean spam folder?
Nice tut there!
Trackbacks: