Empty Trash
Added back in WordPress version 2.9,聽 WordPress Trash will automatically get deleted every 30 days. This trash will permanently delete any Posts, pages, attachments, and comments that were sent to Trash. By default, this happens every 30 days.
There is a way, however, to change that, if you want to. If you are making a lot of changes, if you are not sure of creating a post and then delete them, or you delete a lot of spam comments, you might want to empty the trash on a more regular basis – and do it automacgically!
Once again, I have to give my warning… First make a back up of your site files – not just your database. In order to change the trash schedule, you will need to modify one of the core WordPress files:
wp-config.php
This file gets created when you installed WordPress onto your site. You may or may not have the line needed in the wp-config file. If it not there, simply add the line at the end of the file. If it is there, You can change
define('EMPTY_TRASH_DAYS', 30 ); // 30 days
To disable trash set the number of days to zero. Note that WordPress will not ask for confirmation when someone clicks on “Delete Permanently”.
define('EMPTY_TRASH_DAYS', 0 ); // zero days
Again, make sure you are careful with these changes – deleting the wrong character by mistake could make your day a little less than enjoyable 馃檪
Paul says
Wow! I already had 2 people ask if I would make this change for them. If you want any work done, just send me a note via the Contact Page and I will get back to you!
Roy A. Ackerman, Ph.D., E.A. @Cerebrations.biz says
I believe we must empty our own trash- often. Before it begins to accumulate and detract from the performance (or environmental odors) of the whole…
Paul says
Yes, Roy! I always love your comments!
denny hagel says
Love the value you always provide in your articles and this one is no exception! Thanks and happy holidays!:)
Paul says
Thanks, Denny! Happy Holiday to you as well!
Annemarie Cross says
Another great post Paul; thank you!
Paul says
My pleasure, Annemarie!
Elvie Look says
Wow, I never even thought of this before. Thanks for keeping us on top of WordPress!
Paul says
Elvie – I hope I am not giving you too much info that is making your head spin!
Hughie Bagnell says
Thank you Paul for your advice on WordPress…I have fortunately established the habit of doing this daily on a manual basis…always great advice! …Cheers, Hughie 馃檪