Web Development

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

[cc lang=”php”]
//empty WordPress trash once a week
define(‘EMPTY_TRASH_DAYS’, 7);
[/cc]

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

[cc lang=”php”]
//Disable Empty Trash Functionality
define(‘EMPTY_TRASH_DAYS’, 0);
[/cc]

Shares:

Leave a Reply

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