How to Empty Trash Automatically After Some Day in WordPress

| Last Updated: | In: WordPress, WordPress Snippets


Hi friends, hope you are doing good. This is a very short tutorial about WordPress tips, this tips will help you more while developing WordPress websites.

If you want to delete all trash items automatically after a certain day from your WordPress websites, then this tutorial help you more, keep your close attention in this post as I am going to share how to empty trash automatically after some day in WordPress.

How to Empty Trash Automatically After Some Day in WordPress

Open wp-config.php file from root directory of your website and copy paste below code snippet at the end of the file and save it. below code will automatically be deleted the trash items from your WordPress websites. It will work for WordPress posts and WordPress pages trash to empty automatically after you 5 days.

Hope this tutorial help you, if you have any WordPress related question, then add your comments in bellow comment section. I will be happy to answer your comments and also do like & share this article with your friends on social media also subscribe my blog to get all my new tips and tricks directly in your mail box.


About: Prem Tiwari

Prem Tiwari is the founder of freewebmentor.com and is a professional developer who has vast experience in PHP and open source technologies. Apart from this, he is a blogger by hobby and also he has been a regular speaker of WordPress sessions in various IT Companies.


You may also like:


, , , , , ,