How To Disable Trash in WordPress

The trash feature was introduced with WordPress 2.9. It basically work just like recycle bin on your Windows system. When you delete any comment or post, it goes into trash, so that you can restore it later if you realize that it was deleted accidentally.

By default, anything in trash is stored for 30 days, unless you delete it manually. You may want to disable trash in WordPress to save database memory, or for any other reason. You can do it easily.

How To Disable Trash in WordPress

Just add the following line in your wp-config.php file,

define('EMPTY_TRASH_DAYS', 0);

That’s it. You’ll now see “Delete Permanently” link instead of “Trash”.

disable trash in wordpress How To Disable Trash in WordPress

One More WordPress Trash Hack

Instead of disabling trash completely, I suggest limiting the number of days WordPress stores the trashed content. To change it, just add the following line in your wp-config.php file,

define('EMPTY_TRASH_DAYS', 3);

This will tell WordPress to empty trash after every three days. You can configure the number of days to suit your requirements.

share on twitter

Leave a Reply