There are a few reasons why you might need to automatically delete comments based on date. For maintenance or even performance.
A while back me and my friend Pedro Carvalho where working a project that needed this feature for legal reasons. We developed a plugin and decided to release it in the WordPress plugin repository with the permission of the project managers.
Delete Old Comments is very simple, non intrusive plugin. It will provide you a few options to automate the task of deleting comments based on age. They can either be sent to trash or permanently deleted.
The plugin will offer you 3 simple settings:
- Recurrence – How often to check for old comments
- Age – Set how old they need to be to exclude them
- Operation Type – set if the operation will trash the old comments or permanently delete them.
The new settings will be added to the ‘Discussion’ settings page.
We hope this simple plugin is helpful if someone else needs to implement this feature.
Feel free to leave feedback or ask any question either in the comments section below or on the plugin page.
Web developer based in Porto, Portugal, working mostly with WordPress.
Disclosure: Some of the links in this blog are ‘affiliate links.’ This means if you click on a link to a commercial product and purchase the item, I will receive an affiliate commission.