WordPress Empty Trash Automatically

In order to make sure that your wordpress’ trashed posts and pages gets deleted after some duration.

WordPress has left a scope for this. By default this duration is set to 30 days. But still we can declare a another time or can disable this features also.

In order to specify the trash empty time please follow below steps:

First open your wp-config.php file.
Place below code in that file

//empty WordPress trash once a week define('EMPTY_TRASH_DAYS', 7);
//empty WordPress trash once a week
define('EMPTY_TRASH_DAYS', 7);

To disable this features place below code in your wp-config.php file, that mean wordpress will not clear your trash by its own.

//Disable Empty Trash Functionality define('EMPTY_TRASH_DAYS', 0);
//Disable Empty Trash Functionality
define('EMPTY_TRASH_DAYS', 0);

Share This Article