How to change how long items are kept in the trash?

When the trash feature is enabled, the deleted posts are moved to trash and stored there for 30 days. And there is a schedule/wp_cron event that is responsible for removing these posts permanently after that time.

Is there any easy way to change that time?

1 Answer
1

You can change that in wp-config (https://codex.wordpress.org/Editing_wp-config.php#Empty_Trash):

define( 'EMPTY_TRASH_DAYS', 1 ); // Integer is the amount of days

Leave a Comment