Currently I'm using wp-optimize to remove all trashed posts, trashed comments, draft posts

However, this plugin sometimes not working and more important, it does not delete any trashed items from custom post type which I've from other plugins or built-in from theme. So is there any way or plugin that help me to achieve this task automatically?

  • Why don't you enable the option to automatically empty trash daily or weekly. Is there any specific reason for not doing that and using a plugin?
    – Robert hue
    Commented Oct 2, 2014 at 8:20

2 Answers 2


You can use, in your wp-config.php:

define('EMPTY_TRASH_DAYS', 2 );

The example above will delete trashed posts (of all types) after 2 days.


you can use bulk delete plugin


thank you budy

  • that plugin, right there in the description, do not delete trash, and most likely it does not do it automatically Commented May 16, 2017 at 13:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.