Family Encyclopedia >> Electronics

How to Automatically Empty Your WordPress Trash

In WordPress 2.9, there was a new "Junk" feature added to the core. This function works just like the recycle bin, so instead of permanently deleting the post, it would send it to the trash. This helped those users who accidentally clicked the delete button, and it can be any of us. The bad thing about this trash can feature is that you have to empty the trash can regularly. By default the trash is emptied every 30 days. But in this article, we will show you how you can automatically empty your trash daily, weekly, or for as many days as you like.

All you have to do is open your wp-config.php proceedings. This will is usually located in the same directory where wp-includes is located.

define ('EMPTY_TRASH_DAYS', 1); // Entero es la cantidad de días

Change the 1 to 7 or as many days as you want. If you don't like the garbage feature, then you can always set the number to 0 and get rid of it completely.