Modifying the Automatic WordPress Trash

Posted OnNov 1, 2013     CategoryDevelopment     CommentsNo comment

In WordPress, posts, pages, attachments, and comments, that are deleted, are kept in the trash for 30 days before automatically being deleted permanently. These take up room on your server in the form of files, and in terms of database size.

If you would like to change the frequency with which the trash empties, you may use the following steps. To do this, you will need FTP, SFTP, or SSH access to your server.

Step 1) Log in to your server with FTP, SFTP, or SSH

Step 2) Locate and open wp-config.php

Step 3) Add the following to wp-config.php, changing the numeric value to whatever suits your needs

define( 'EMPTY_TRASH_DAYS', 17 ); // 17 days

Step 4) Save your changes to wp-config.php

Leave a Reply

Your email address will not be published. Required fields are marked *

Send this to friend