How to make WordPress empty the recycle bin automatically

Recycle bin is a new function added after WordPress is upgraded to 2.9. When an item (log, comment, etc.) is deleted, it is not permanently deleted. Instead, it is stored in the recycle bin. If the deletion is wrong, it can be recovered. But sometimes, when you really think that it is unnecessary to keep the deleted items, you need to empty the recycle bin manually. It’s troublesome. Here’s a trick to specify WordPress to empty the garbage bin automatically every fixed number of days.

Open your WordPress root, WP- config.php File and paste the following code:

define('EMPTY_TRASH_DAYS', 10 );

The number 10 above stands for 10 days. When the number is set to 0, the recycle bin function is disabled.

Related Article
WordPress displays the registration time of the login user in the frontend

When using WordPress to build a website, some users want to display the user registration time in the frontend, but Read more

WordPress adds the number of SQL queries at the bottom

An excellent woodpress theme is definitely that the less SQL consulting is used, the better. How can we see how Read more

Some WordPress articles can be seen after comments / replies

If we want to hide part of the content of the article and need the user's comments and replies to Read more

WordPress common template function reference document

Basic template filefile namedescribe style.css Theme style file index.php Home page template file header.php Header template file single.php Single article Read more

Leave a Reply

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

*
To prove you're a person (not a spam script), type the security word shown in the picture.
Anti-spam image