Loading...

Monday, April 4, 2011

Automatically Empty Trash Folder in Wordpress

The most frustrating problem every blog owner faces is "SPAM comments". Dealing with numerous SPAM comments is really a tedious job. There are some plugins like "Delete All Pending Comments" which helps in deleting all comments in bulk. And the deleted comments will be moved to Trash folder. It's again a big problem to go to Trash folder and delete those manually.

Remove Wordpress TrashTo speed up the task and reduce personal intervention, there is a small hack which allows us to empty the trash automatically without having to do it manually each time.

  1. Login to your FTP and Download wp-config.php file and edit it.
  2. Add below code in it
  3. define('EMPTY_TRASH_DAYS', 5 );
  4. Save the file and upload it back.
In the above command, the digit 5 states that for every 5 days, the trash need to be deleted. Replace the number with the number of days you desire.

Note: You can also open the wp-config.php file direct by logging into your control panel and edit it.

2 comments:

  1. But what if I hit the trash button for all the post by mistake. Will that be deleted or will that stay?

    ReplyDelete

 

Receive all updates via Google+ and Facebook. Just Click the Like Button Below