Delete Unreplied Topics plugin

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.

This work has been sponsored by @outofthebox.

13 Likes

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

8 Likes

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 :slight_smile:

2 Likes

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

5 Likes

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.

1 Like

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!

4 Likes

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.

1 Like

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.

2 Likes


Do you know why these error messages appear?

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

2 Likes

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?

1 Like

It was just written very well :sunglasses:

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.

3 Likes

Perfect. Thanks for the quick response!

1 Like