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”.

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.


One Response to “How To Disable Trash in WordPress”

  1. Upgrade To Wordpress 2.9.2 Now! on February 16th, 2010

    [...] recycle bin in Windows operating system. All the deleted posts and comments go to trash. You can disable trash in WordPress, but its activated by [...]

Got something to say?

Wordpress installation, upgrade, plugins and theme development are my forte. If you want to spend more time blogging and less time fiddling with your templates, plugins and technical issues, I can help. Find out more about my services, then contact me.

Wordpress Tips, Tricks & Hacks!

Make Money With Wordpress!

Try Aweber for $1 Studiopress Themes

News!