Configuring Trash

Back in November I mentioned a few of the cool new features introduced to WordPress 2.9, one of them being Trash. (see WordPress 2.9 Brings Cool New Features) With Trash enabled, should you accidentally delete any type of content such as post, page, comment etc it is moved to Trash where it can then be either restored or permanently deleted ala the Windows Recycle Bin. The default setting for content to remain in Trash before it gets deleted is 30 days. Did you know you can change that via the wp-config.php file?

Let's say that you want to change the default setting from 30 days to 7 days. Add the following to the wp-config.php file ...

define('EMPTY_TRASH_DAYS', 7 );

You can adjust the number to anything you want. If you want to disable Trash change the number to 0 as such ...

define('EMPTY_TRASH_DAYS', 0 );

To see a cool list of configuration settings that can be set/changed via wp-config check out the documentation at the Codex.

post
About Len Kutchma

Len has been blogging for over 10 years and is a rabid WordPress fan. In addition to blogging here you can find him writing the occasional article and toiling away in the forums at WeblogToolsCollection.com. He also hangs out at the WordPress support forums lending a hand where he can. Be sure to follow @wpcanada on Twitter.

Comments

  1. Ryan says:

    This is a bit clever I'd say. :D

    • Len Kutchma says:

      Hi Ryan, thanks for stopping by.

      That's an interesting site you have. When I have some more free time this weekend I'll have to check it out in more detail and sign up. :)

Please Note: WPCanada is a moderated community. Please read the Comment Policy.

What Do You Think?

*