Empty The WordPress Trash

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 🙂

 

Similar Posts

10 Comments

  1. 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!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.