Title: Auto remove non commented posts
Last modified: August 21, 2016

---

# Auto remove non commented posts

 *  Resolved [anjanphukan](https://wordpress.org/support/users/anjanphukan/)
 * (@anjanphukan)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/auto-remove-non-commented-posts-1/)
 * Is it possible to delete only those posts which don’t have any comments.
 * Because deletion of a commented post might not be good.
 * [https://wordpress.org/plugins/auto-prune-posts/](https://wordpress.org/plugins/auto-prune-posts/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [ramon fincken](https://wordpress.org/support/users/ramon-fincken/)
 * (@ramon-fincken)
 * [12 years ago](https://wordpress.org/support/topic/auto-remove-non-commented-posts-1/#post-4591555)
 * I am looking into WP_query,
 * if you are in a hurry feel free to change this while loop
 *     ```
       if ($post_date_plus_visibleperiod < $now) {
       							// GOGOGO !
       							$this->delete_post_and_attachments($post->ID,$force_delete);
   
       							// Mail admin?
       							if(!empty($this->conf['settings']['admin_email']))
       							{
       								$body = "Deleting post ID : ".$post->ID. "\n";
       								$body .= "Post title : ".$post->post_title. "\n";
       								$body .= "Settings (Delete or Trash) : ".( ($force_delete) ? 'Delete' : 'Trash' ). "\n";
       								wp_mail($this->conf['settings']['admin_email'],'Plugin auto prune posts notification',$body);
       							}
       						}
       ```
   
 * adding an if statement based on post->comment_count
 *  Plugin Author [ramon fincken](https://wordpress.org/support/users/ramon-fincken/)
 * (@ramon-fincken)
 * [12 years ago](https://wordpress.org/support/topic/auto-remove-non-commented-posts-1/#post-4591560)
 * I’ve written a patch for WordPress Core and hope to submit it real soon.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Auto remove non commented posts’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/auto-prune-posts.svg)
 * [Auto Prune Posts](https://wordpress.org/plugins/auto-prune-posts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/auto-prune-posts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/auto-prune-posts/)
 * [Active Topics](https://wordpress.org/support/plugin/auto-prune-posts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/auto-prune-posts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/auto-prune-posts/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [ramon fincken](https://wordpress.org/support/users/ramon-fincken/)
 * Last activity: [12 years ago](https://wordpress.org/support/topic/auto-remove-non-commented-posts-1/#post-4591560)
 * Status: resolved