How to configure trash bin in WordPress admin


There are a lot of specific codes and tips on how to enhance your WordPress without using any plugins, that eventually make your website more and more heavy.

This code below shows you an easy way to configure your trash bin in WordPress, to make it automatically empty itself in a specific period.

The default setting for content to remain in trash before it gets deleted is 30 days. You can change that period.

To do that, go to your “wp-config.php” file, and add the following code there:

define(‘EMPTY_TRASH_DAYS’, 7 );

The code above tells WordPress to empty the trash each week.

You can adjust the number to anything you want. If you want to disable Trash change the number to 0 as such …

define(‘EMPTY_TRASH_DAYS’, 0 );

Comments are closed.