Automatically Empty Trash Posts In WordPress
Do you create posts just to delete them half way when you realise their not good enough to be put up on your site?
Lots of people create a post and end up deleting it. After a while your trashed posts folder could fill up, which can have performance problems on your WordPress site. You need to keep going back and emptying your trashed posts but what if you keep forgetting you reach the same problem.
Let WordPress automatically empty your trash posts.
Copy the following snippet into your WordPress config file to empty your trash every week.
define('EMPTY_TRASH_DAYS', 7 );
Learn how to code with Treehouse
- Learn projects with access to 1000+ videos
- Practice live with our Code Challenge Engine
- Get help in our members-only forums
- Access 100s of premium tutorials and downloadable content
- Members content consists of premium WordPress plugins
- CSS packages, jQuery packages, tutorial demo files and templates for 100s of web development tutorials
- In-depth development tutorials
- Priority tutorial requests
- No ads
- First month free!