How to Automatically Empty WordPress Trash Daily

Do you want to learn how to delete trash from WordPress on a daily basis? WordPress, like many other blogging platforms, is susceptible to spam. Deleting spam cannot only be a tedious task but also can also quickly fill up the WordPress trash with hundreds of deleted comments.

How often does WordPress delete trash?

WordPress deletes trash every 30 days. Therefore,all those comments that you had placed in the trash will eventually disappear. However, if you want your account to be more efficient or would prefer to see hundreds of messages in the trash be deleted on a regular basis, then there is a way.

How to empty WordPress trash daily

You can decide how often to delete your WordPress trash by adding this code in the WordPress root directory, under the wp-config.php file. The code is displayed below:

Define (‘ EMPTY_TRASH_DAYS ‘, 1 ) ;

The “1” in the code represents the frequency on how often the trash will deleted from WordPress. Therefore with “1” in the code, WordPress trash would be deleted every day but it can be changed to one’s preference. A “0” in the code however, will disable the automatic mechanism of deleting trash.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: