# Delete Unreplied Topics plugin

**URL:** https://meta.discourse.org/t/delete-unreplied-topics-plugin/163546
**Category:** Plugin
**Created:** [September 9, 2020, 7:42pm UTC](https://meta.discourse.org/t/delete-unreplied-topics-plugin/163546 "2020-09-09T19:42:39Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [September 9, 2020, 7:42pm UTC](https://meta.discourse.org/t/delete-unreplied-topics-plugin/163546/1 "2020-09-09T19:42:39Z")

</div>

The **Delete Unreplied Topics** plugin scans designated categories for topics that exist over x days which did not get any replies, and deletes them. This keeps your forum clean of topics that did not gain any traction for whatever reason.

Settings:

- `delete_unreplied_topics_categories` the categories to work on
- `delete_unreplied_topics_days` the amount of days before a topic without any posts will be deleted
- `delete_unreplied_topics_dry_run` a safety net to test and make sure the plugin will not delete unwanted parts of your forum

The plugin logs its actions in `/logs`.

The repository can be found [here](https://github.com/communiteq/discourse-delete-unreplied-topics).

This work has been sponsored by @outofthebox.

---

<div class="post-metadata">

### Author: ![outofthebox](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/outofthebox/32/83708_2.png) [@outofthebox](https://meta.discourse.org/u/outofthebox)
#### Post date: [September 9, 2020, 7:48pm UTC](https://meta.discourse.org/t/delete-unreplied-topics-plugin/163546/2 "2020-09-09T19:48:36Z")

</div>

Amazing work @RGJ! Your skillful development of this plugin is a huge time saver and greatly improves our community.

---

<div class="post-metadata">

### Author: ![Jonathan5](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jonathan5/32/197134_2.png) [@Jonathan5](https://meta.discourse.org/u/Jonathan5)
#### Post date: [October 18, 2020, 6:57am UTC](https://meta.discourse.org/t/delete-unreplied-topics-plugin/163546/3 "2020-10-18T06:57:03Z")

</div>

Thank you for writing this.

It would be good if it would log the topic title as well as ID (`DeleteUnrepliedTopics removing Topic ID #{t.id}`).

And it would be more reassuring if `delete_unreplied_topics_dry_run` would default to true 🙂

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [October 18, 2020, 8:38am UTC](https://meta.discourse.org/t/delete-unreplied-topics-plugin/163546/4 "2020-10-18T08:38:23Z")

</div>

Thank you, those are very useful suggestions. I have made those changes.

---

<div class="post-metadata">

### Author: ![Jonathan5](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jonathan5/32/197134_2.png) [@Jonathan5](https://meta.discourse.org/u/Jonathan5)
#### Post date: [May 4, 2021, 9:22pm UTC](https://meta.discourse.org/t/delete-unreplied-topics-plugin/163546/5 "2021-05-04T21:22:53Z")

</div>

I finally installed this plugin, so far in dry run mode. It seems correctly to identify the topics to delete.

In the logs each line like `DeleteUnrepliedTopics would remove Topic ID *number* (*topic title*) (dry run mode)` is preceded by the X indicator for an “Error”. I’d have expected it be “Info” or even “Warning”.

@RGJ Is that expected? Thanks. I’m using the latest version of Discourse.

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [May 5, 2021, 3:03am UTC](https://meta.discourse.org/t/delete-unreplied-topics-plugin/163546/6 "2021-05-05T03:03:48Z")

</div>

Yes, that seems to be by design. I vaguely remember that there was some issue with debug levels so I made it to be an `error`. Sorry for any confusion!

---

<div class="post-metadata">

### Author: ![Jonathan5](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jonathan5/32/197134_2.png) [@Jonathan5](https://meta.discourse.org/u/Jonathan5)
#### Post date: [May 6, 2021, 9:54pm UTC](https://meta.discourse.org/t/delete-unreplied-topics-plugin/163546/7 "2021-05-06T21:54:47Z")

</div>

Thanks for clarifying that. The plugin works as expected, thanks - though, interestingly, unlisted topics are displayed by Discourse as having at least one reply (i.e. the act of unlisting) which means your plugin does not delete them.

---

<div class="post-metadata">

### Author: ![Jonathan5](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jonathan5/32/197134_2.png) [@Jonathan5](https://meta.discourse.org/u/Jonathan5)
#### Post date: [May 17, 2022, 2:10pm UTC](https://meta.discourse.org/t/delete-unreplied-topics-plugin/163546/8 "2022-05-17T14:10:22Z")

</div>

I’ve just noticed that your plugin doesn’t delete pinned topics either, as the act of pinning a topic is deemed to be a reply. This turns out to be a good thing.

---

<div class="post-metadata">

### Author: ![danielabc](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@danielabc](https://meta.discourse.org/u/danielabc)
#### Post date: [February 1, 2024, 1:03am UTC](https://meta.discourse.org/t/delete-unreplied-topics-plugin/163546/9 "2024-02-01T01:03:21Z")

</div>

![image](https://global.discourse-cdn.com/meta/original/4X/5/6/6/566bfd40d7ad2245b8498483fb1b94a6a47eb25c.png)  
Do you know why these error messages appear?

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [February 1, 2024, 8:07am UTC](https://meta.discourse.org/t/delete-unreplied-topics-plugin/163546/10 "2024-02-01T08:07:26Z")

</div>

> [@RGJ](#):
>
> `delete_unreplied_topics_dry_run` a safety net to test and make sure the plugin will not delete unwanted parts of your forum

When this is enabled the plugin will only log its actions and not actually perform them.

---

<div class="post-metadata">

### Author: ![gschmid](https://avatars.discourse-cdn.com/v4/letter/g/a698b9/32.png) [@gschmid](https://meta.discourse.org/u/gschmid)
#### Post date: [February 6, 2024, 4:19pm UTC](https://meta.discourse.org/t/delete-unreplied-topics-plugin/163546/11 "2024-02-06T16:19:57Z")

</div>

Hello,  
this plugin seems to be exactly what I’m looking for, but I’m a bit anxious to install it as there hasn’t been any activity in the repo for 4 years.  
Do you think it should still be working with current Discourse version, or is it likely to break anything?

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [February 6, 2024, 4:47pm UTC](https://meta.discourse.org/t/delete-unreplied-topics-plugin/163546/12 "2024-02-06T16:47:55Z")

</div>

It was just written very well 🕶

And it’s a very specific plugin. I’m 99,9% sure it still works correctly.  
You can first set it to “dry run” so it won’t break anything, if that comforts you.

---

<div class="post-metadata">

### Author: ![gschmid](https://avatars.discourse-cdn.com/v4/letter/g/a698b9/32.png) [@gschmid](https://meta.discourse.org/u/gschmid)
#### Post date: [February 6, 2024, 4:56pm UTC](https://meta.discourse.org/t/delete-unreplied-topics-plugin/163546/13 "2024-02-06T16:56:13Z")

</div>

Perfect. Thanks for the quick response!

---

<div class="post-metadata">

### Author: ![alltiagocom](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alltiagocom/32/492709_2.png) [@alltiagocom](https://meta.discourse.org/u/alltiagocom)
#### Post date: [March 8, 2025, 10:56am UTC](https://meta.discourse.org/t/delete-unreplied-topics-plugin/163546/14 "2025-03-08T10:56:43Z")

</div>

@RGJ based on multiple requests from other users:

> [@Category-level auto-delete topics the same as auto-close feature](https://meta.discourse.org/t/category-level-auto-delete-topics-the-same-as-auto-close-feature/138361/16):
>
> Found this plugin which answers my need:

couldn’t this plugin of yours be used as the foundation for a new plugin that deletes topics in a particular category if they are older than N days, set by the user?

If your plugin is already scanning topics, wouldn’t it possible to set some rules that say:  
_If category is X, scan for topics where the creation date and the current date is more than N days, and if so, delete them._

I don’t know the ins and outs of creating and changing plugins, but this would be a great addition.

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [March 8, 2025, 12:25pm UTC](https://meta.discourse.org/t/delete-unreplied-topics-plugin/163546/15 "2025-03-08T12:25:16Z")

</div>

It would be a matter of removing a [single line](https://github.com/communiteq/discourse-delete-unreplied-topics/blob/master/jobs/scheduled/delete_unreplied_topics.rb#L14). (Or, obviously, creating a setting `max_replies`, default 0, which can then be set to 99999 to accomplish the desired effect).

That said, I’m struggling to think of a good use case for this.

---

<div class="post-metadata">

### Author: ![Heliosurge](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/heliosurge/32/571810_2.png) [@Heliosurge](https://meta.discourse.org/u/Heliosurge)
#### Post date: [March 9, 2025, 7:54am UTC](https://meta.discourse.org/t/delete-unreplied-topics-plugin/163546/16 "2025-03-09T07:54:13Z")

</div>

One case use I could think of would be maybe a ln off topic lounge that resets each month. As meant for maybe a let off steam type free for all.

Otherwise not sure either of many use cases. Plus though ATM think it is manual only unless an automation could be made. To simply apply topic timer with the delete function? Don’t recall if it gives option to delete topic or if it is just replies.

---

<div class="post-metadata">

### Author: ![alltiagocom](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alltiagocom/32/492709_2.png) [@alltiagocom](https://meta.discourse.org/u/alltiagocom)
#### Post date: [March 9, 2025, 11:48am UTC](https://meta.discourse.org/t/delete-unreplied-topics-plugin/163546/17 "2025-03-09T11:48:28Z")

</div>

There’s a discussion about different cases here:

> [@Category-level auto-delete topics the same as auto-close feature](https://meta.discourse.org/t/category-level-auto-delete-topics-the-same-as-auto-close-feature/138361/10):
>
> Yes. I think options could be: Only delete closed topics Only delete archived topics Don’t delete closed topics Don’t delete archived topics Don’t delete closed topics Don’t delete pinned topics Don’t delete topics with solutions[[1]](#footnote-1238682-1) Don’t delete topics with at least \_\_\_\_ hearts (or other reactions) Don’t delete topics with at least \_\_\_\_ votes[[2]](#footnote-1238682-2) Don’t delete topics with at least \_\_\_\_ replies Also: if this does get attention sometime, it makes sense to me to add “Archive” at the sam…

For my particular case (similar to one of the users on that topic above), I would like to have a category called “Classifieds” for musicians (e.g. singers who want to find producers and vice-versa), but I don’t want topics to be available forever, or that get renewed just by adding a new reply. I want to set a timer, for example, where all topics inside that category that are 2 weeks old get deleted, regardless of the replies. That way, users know that they need to create a new topic, instead of just adding a meaningless reply such as an emoji, otherwise the topic will be filled with 1 emoji replies, which looks bad. It also forces users who _really_ want to find people to work with, to put in the work and create a new topic. This kinda filters out people who are too lazy to create a new topic, save their text on their computer or phone, etc.

Hope it makes sense?

So if this indeed becomes a plugin and I’m using Communiteq for my hosting, what plan would I need to be on to being able to install the plugin?

---

<div class="post-metadata">

### Author: ![michaeld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/michaeld/32/1594_2.png) [@michaeld](https://meta.discourse.org/u/michaeld)
#### Post date: [March 9, 2025, 12:58pm UTC](https://meta.discourse.org/t/delete-unreplied-topics-plugin/163546/18 "2025-03-09T12:58:57Z")

</div>

> [@alltiagocom](#):
>
> That way, users know that they need to create a new topic

You could set auto-close on the topics?

> [@alltiagocom](#):
>
> So if this indeed becomes a plugin and I’m using Communiteq for my hosting, what plan would I need to be on to being able to install the plugin?

That would be the Professional plan.

---

<div class="post-metadata">

### Author: ![alltiagocom](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alltiagocom/32/492709_2.png) [@alltiagocom](https://meta.discourse.org/u/alltiagocom)
#### Post date: [March 9, 2025, 1:28pm UTC](https://meta.discourse.org/t/delete-unreplied-topics-plugin/163546/19 "2025-03-09T13:28:20Z")

</div>

> [@michaeld](#):
>
> You could set auto-close on the topics?

This would be less effective than your plug-in, because it would allow old topics to be visible when they are no longer effective. Why would I want topics of people looking for musicians from 3 years ago? I want them deleted.

Also, closing the topic is the same as your plug-in: it depends on replies, which is not what I would like to have. As i mentioned, this would be prone to having users just adding an emoji type comment to let the topic stay active.

I basically just want topics to be deleted after N days/weeks, no matter what. And as you can see from the topic I shared, other users have the same need. Since your plug-in is already doing something similar, I would assume that creating a version to delete regardless of the replies wouldn’t be a big deal and each admin could pick what they want for their forum based on their needs.

---

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [March 9, 2025, 2:09pm UTC](https://meta.discourse.org/t/delete-unreplied-topics-plugin/163546/20 "2025-03-09T14:09:43Z")

</div>

> [@alltiagocom](#):
>
> Why would I want topics of people looking for musicians from 3 years ago?

Wrong question, BTW. What you want is totally unrelevant. What a user want is relevant. And topics don’t cost anything.

[Next page](https://meta.discourse.org/t/delete-unreplied-topics-plugin/163546.md?page=2)
