How to Automatically Empty WordPress Trash Daily

Do you wish to delete and empty WordPress Trash daily? We delete many spam WordPress comments everyday and WordPress Trash fills up really fast. Often the Trash accumulates thousands of comments. How to empty Trash automatically?

Empty wordpress thrash

Does WordPress empty Trash ever? WordPress will permanently delete posts, pages or comments in the trash after 30 days automatically. So dont worry about accumulating thousands of Trash files.

How to empty WordPress Trash Daily

You can decide when to empty the WordPress trash by adding this code to the wp-config.php file in your WordPress root directory.

define('EMPTY_TRASH_DAYS', 1 );

The 1 in the code signifies you want to empty the trash everyday. If you use a value like 5, it will empty trash every 5 days. If you set to 0, the trash functionality will be disabled and the ‘Delete Permanently’ button will appear instead of ‘Trash’ button and then you can delete posts and comments permanently without any alert.┬áRemember to always backup wp-config.php file before editing it or your blog function may be disrupted.

Now never click Empty Trash ever again.

Share with friends

9
Leave a Reply

avatar
9 Comment threads
0 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
9 Comment authors
promosyonSwamykantCriar MSNPraveeneTipsLibrary Recent comment authors
  Subscribe  
newest oldest most voted
Notify of
Hariom
Hariom

Very handy tip about optimising wp database and free the database from spam comments. Any config hack to avoid spam comments will greately help the spam commenters in first place.

Trung @ Blogging 24 Hours
Trung @ Blogging 24 Hours

Very simply and useful tips, thanks so much!

Tech Crates
Tech Crates

Great tip…. Will make use of it to save some time that can be invested in marketing

Mandarin Man
Mandarin Man

Good info here, I’m going to do this on all my wordpress sites.

eTipsLibrary
eTipsLibrary

Great and interesting tip. Most of wordpress users will adopt it.

Praveen
Praveen

Nice Idea, i don’t like to have things in trash!

Cheers !

Criar MSN
Criar MSN

Very good this tip!

It really is very helpful!

Swamykant
Swamykant

Simple and easy to use trick. Thanks for share.

promosyon
promosyon

Your site is very good. There are useful information and most importantly, for sharing great. Thank you.