# Limit the amount of topics per user in a specific category

**URL:** https://meta.discourse.org/t/limit-the-amount-of-topics-per-user-in-a-specific-category/84907
**Category:** Plugin
**Created:** [4월 9, 2018, 6:37오후 UTC](https://meta.discourse.org/t/limit-the-amount-of-topics-per-user-in-a-specific-category/84907 "2018-04-09T18:37:39Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Vespura](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vespura/32/206564_2.png) [@Vespura](https://meta.discourse.org/u/Vespura)
#### Post date: [4월 9, 2018, 6:37오후 UTC](https://meta.discourse.org/t/limit-the-amount-of-topics-per-user-in-a-specific-category/84907/1 "2018-04-09T18:37:39Z")

</div>

Originally got the idea from this topic: [Limit one post per person?](https://meta.discourse.org/t/limit-one-post-per-person/80072) though I had a slightly different use case for it.

On a community that I’m a forum moderator for, I got tired of people creating multiple advertisement topics in the advertising section. At first, I created a feature request on these forums, but after some trial and error I came up with my own plugin that does the job.

> **Current features list**
>
> - Configurable list of enabled categories is availalbe in the admin settings page.
> - Configurable message that will be used to notify the user that their post was closed.
> - Configurable amount of allowed topics one can post in a category before it is blocked.
> - Configurable toggle to ignore staff members creating topics.
> - Configurable toggle to delete the closed topic after 24 hours.

Of course there are plenty of things that can/need to be improved but considering this is my first plugin that I tried to make _myself_ (instead of editing others) I feel like it was worth releasing for anyone that wants to use or improve it.

[https://github.com/TomGrobbe/discourse-topic-limit](https://github.com/TomGrobbe/discourse-topic-limit)

> **Screenshots**
>
> This is what you’ll see when you create an excess topic:
> 
> ![](https://global.discourse-cdn.com/meta/original/3X/7/3/73163fe103c41f5566c289115ea8bf0098c46c34.png)
> 
> And this is what the admin settings look like:
> 
> ![](https://global.discourse-cdn.com/meta/original/3X/3/1/31056a01ef69c9bf7124d1a88a8477aefa67f83b.png)

Feel free to fork, pr or edit it however you like. I’d love to see some improvements by the community. This would also help me out while starting to learn more about discourse plugin development. 🙂

> **Planned features**
>
> - ~~Something I would like to add later on is an option to auto-delete the closed topics 24 hours after being closed. But so far I’ve not been able to figure out how to set a Topic Timer when using Ruby. If anyone can help me figure this out: that’d be great!~~  
> This has been added in a recent update (13-04-2018), it now has a configurable toggle in the admin settings page to enable/disable topic deleting after 24 hours.
> - Not sure if this will be added anytime soon, but I’m hoping to implement these features into the UI itself to prevent users from creating the topic in the first place, instead of locking the new topic they just created. If anyone wants to help me create this then please let me know because I could use some help figuring this out.
> - Add configuration options in the category settings page and allow for category-specific limits and options.

---

<div class="post-metadata">

### Author: ![Vespura](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vespura/32/206564_2.png) [@Vespura](https://meta.discourse.org/u/Vespura)
#### Post date: [4월 12, 2018, 11:21오후 UTC](https://meta.discourse.org/t/limit-the-amount-of-topics-per-user-in-a-specific-category/84907/3 "2018-04-12T23:21:43Z")

</div>

Support for multiple categories has been added in [this commit](https://github.com/TomGrobbe/discourse-topic-limit/commit/f9417a54dea76e46865cbe9754d205c20095b151). Note that all settings (the amount of topics per category, staff exemption, etc) are shared/used for all those enabled categories. There’s no option to set per-category limits right now.

---

<div class="post-metadata">

### Author: ![Vespura](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vespura/32/206564_2.png) [@Vespura](https://meta.discourse.org/u/Vespura)
#### Post date: [4월 13, 2018, 12:27오후 UTC](https://meta.discourse.org/t/limit-the-amount-of-topics-per-user-in-a-specific-category/84907/4 "2018-04-13T12:27:57Z")

</div>

Automatic deletion of the closed topics after 5 minutes is now added as an option in the admin settings. (Enabled by default)

---

<div class="post-metadata">

### Author: ![ChrisBeach](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chrisbeach/32/214628_2.png) [@ChrisBeach](https://meta.discourse.org/u/ChrisBeach)
#### Post date: [4월 13, 2018, 2:01오후 UTC](https://meta.discourse.org/t/limit-the-amount-of-topics-per-user-in-a-specific-category/84907/5 "2018-04-13T14:01:26Z")

</div>

Firstly, congrats on releasing a plugin. From experience, I know it’s a non-trivial acheivment!

I’m interested in this type of plugin - in my case I’d like to avoid people dominating certain “firestarter” topics. Although I’d like to deploy a softer implementation that perhaps rate-limited users as opposed to preventing users posting

In fact, it seems a bit heavy-handed to allow the user to take the time to write a post, only for it to be immediately closed/unlisted/deleted afterwards.

With this plugin, I think it would be friendlier if the composer UX was modified to prevent a user wasting time posting a new topic if they’ve reached their limit.

---

<div class="post-metadata">

### Author: ![Vespura](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vespura/32/206564_2.png) [@Vespura](https://meta.discourse.org/u/Vespura)
#### Post date: [4월 13, 2018, 2:06오후 UTC](https://meta.discourse.org/t/limit-the-amount-of-topics-per-user-in-a-specific-category/84907/6 "2018-04-13T14:06:30Z")

</div>

> [@ChrisBeach](#):
>
> With this plugin, I think it would be friendlier if the composer UX was modified to prevent a user wasting time posting a new topic if they’ve reached their limit.

That was indeed my initial goal, but after many attempts not working out the way I needed it: figured this would work for my use case just as much, considering most people just copied their old advertisements and “spam” created a new topic for it every day to “bump” it. Though I do prefer the idea you mentioned, if I find a way to get that to work or if anyone has some suggestions then I’d defninatly change it.

---

<div class="post-metadata">

### Author: ![Vespura](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vespura/32/206564_2.png) [@Vespura](https://meta.discourse.org/u/Vespura)
#### Post date: [4월 24, 2018, 7:09오후 UTC](https://meta.discourse.org/t/limit-the-amount-of-topics-per-user-in-a-specific-category/84907/7 "2018-04-24T19:09:41Z")

</div>

**Small update:**  
Changed the 5 minutes auto-deletion timer to be 24 hours instead, 5 minutes was nice for keeping the forums clean quickly, but it was too quick for most users to realize what was happening or to even “appeal” the auto-closing of the topic before it got deleted. 24 hours gives staff and users enough time to cancel the deletion if there is a need for that.

---

<div class="post-metadata">

### Author: ![Aizada\_M](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/aizada_m/32/352050_2.png) [@Aizada\_M](https://meta.discourse.org/u/Aizada_M)
#### Post date: [11월 22, 2023, 2:59오후 UTC](https://meta.discourse.org/t/limit-the-amount-of-topics-per-user-in-a-specific-category/84907/9 "2023-11-22T14:59:49Z")

</div>

안녕하세요! 최근 Discourse 업데이트 이후 이 플러그인이 정상적으로 작동하나요?
