With the release of WordPress 2.9 comes one of the best additions to the core functionality, the TRASH function. Basically an “un-delete” option, the WordPress Trash function makes it almost impossible to accidentally delete a page, post or comment.
By default, anything ‘thrown’ into the trash will be deleted automatically after 30 days. You can also manually delete anything in the trash by clicking the ‘permanently delete’ link from inside the trash bin, so to speak.
Fortunately, WordPress has add the ability to change the number of days you want to store the trash before automatic deletion. This can be a very good thing for several reasons.
First, should you decide you want to use the trash as a ‘storage bin’ of sorts, to get rid of some older pages or posts that you don’t have live on the site, but want to keep for possible future use should you need too, and not have them clutter up your page, post or comment list.
Second, it makes it useful for those that really do what to get rid of those unwanted items but feel a little hesitant to just delete them and have them disappear immediately into nowhere land, just to realize you probably really didn’t want to delete it in the first place because you needed something out of one of them – it can give them a few extra days to see if they really DID need anything.
As I used to always tell my clients, turn it to a draft instead of deleting it right away (in the case of pages or posts). Then, if you find you really didn’t need it after a week, delete it. If you did need it, then you have it, because once you delete it, it is gone forever! Well, the trash function eliminates that. Trash it, then if you need it, restore it. If not, it will delete on its own after a period of time.
Third, adjusting the days and item is in the trash can make it useful to those that do not want a trash feature. Although, in honesty, I am not sure exactly why you wouldn’t want a little extra reassurance that you won’t ever accidentally delete something – but I guess people are as different as rocks, they all look like rocks on the surface, but inside some contain the most beautiful things – while others have just more dense rock. But – the option is there should you chose it.
The ONLY bad thing about this in my opinion, is that WordPress didn’t make this an option in the settings – exactly why, I’m not sure. They didn’t even make it so the function is ‘hook-able’, so that a plugin could be created to give the option to the user. Instead, you have to do a little work to change them and for a non-programmer, this can be a bit of a daunting task.
I decided to show anyone interested, how to do change the number of days the trash is stored. Not everyone will be able to make this adjustment, but those of you that can, it may be helpful. Maybe WordPress will add this as an option in the near future.
wp-config.php file which is in the root WordPress Folder. So once you locate that, download a copy of it, or open it in your File Manager editor.define ('WPLANG', '');define('EMPTY_TRASH_DAYS', 30 );
30 is the number of days that the trash is saved before automatically emptying it. Change the 30 to whatever number you want – if you want to keep the trash for six months, enter 180, if you only want it to save for a week, enter 7. Should you decide you do not want the Trash function at all, enter 0.EMPTY_TRASH_DAYS are straight up single quotes. If you have a ‘curly’ quote or any other ‘magic’ type quote, change it to a single quote (right next to the ENTER key). Then, save the file.You should now have your trash settings set the way you want them. Remember – you’re in control!
Happy Trashing!
I would like to begin by saying, thank you for supplying me with the information I’ve been looking for. I’ve been searching the internet for three hours looking for it and wish I would have located your website sooner. Not only did I locate what I was searching for, but also found answers to questions I never thought to ask. Thank you for your wonderful web-site!