WordPress 2.9 introduced a new useful feature that has saved me several headaches since its release. Your posts, pages, comments, and custom post types now have a “recycling bin” that temporarily stores content that you’ve deleted. These items remain there for 30 days before WordPress automatically purges the trash.
Sometimes 30 days proves to be more time that you need to store trash items. Sometimes you might want to keep these items longer. Some people might even find it useful to keep these trash items indefinitely. After browsing through the Codex, I came across an option made available to use which allows us to control the length of time items are kept in the trash.
To turn off simply add the following code to your wp-config.php file:
define('EMPTY_TRASH_DAYS', 0);
To shorten the time items are cleared, 10 days for example, simply change the second variable:
define('EMPTY_TRASH_DAYS', 10);
Or to increase the time, say… 60 days:
define('EMPTY_TRASH_DAYS', 60);
As I mentioned before, leaving this option alone will default to 30 days.
No related posts.




