Apply auto-close to existing topics

(Gerhard Schlager) #1

You configured one or more of your categories to auto-close topics and noticed that this applies only to newly created topics in those categories? Don’t worry! There’s a script that applies the auto-close setting to old topics.

Access Your Site

First connect to your Droplet via SSH, and enter the Docker container for your Discourse instances:

cd /var/discourse
./launcher enter app

Apply the auto-close settings

Run this command:

rake topics:apply_autoclose

Topics older than auto-close age should auto-close
Mass-close old topics based on last activity
(Ryan Erwin) #2

When I ran rake topics:apply_autoclose, each of the topics that were closed got marked as having “one unread message”, where the unread message is the system message indicating that the thread is closed.

So for forum powers users that are watching many categories, they’ll see hundreds or thousands of topics show up as “unread” when you run this rake task.

(Sam Saffron) #3

Head to unread and hit dismiss all… :slight_smile: you could script something like this that also pretend reads these topics, or maybe we can teach the rake task to do it, but very very on the fence on it.