# Force users to pick category

**URL:** https://meta.discourse.org/t/force-users-to-pick-category/373164
**Category:** Support
**Tags:** composer
**Created:** [July 7, 2025, 11:42am UTC](https://meta.discourse.org/t/force-users-to-pick-category/373164 "2025-07-07T11:42:08Z")
**Posts on this page:** 20
**Page:** 1

<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: [July 7, 2025, 11:42am UTC](https://meta.discourse.org/t/force-users-to-pick-category/373164/1 "2025-07-07T11:42:08Z")

</div>

I want users to manually pick a category when creating a new post.  
I already checked the topics:

[https://meta.discourse.org/t/invite-people-to-choose-category-before-create-a-new-topic/214077](https://meta.discourse.org/t/invite-people-to-choose-category-before-create-a-new-topic/214077)  
[https://meta.discourse.org/t/require-category-selection-before-writing-topic/66236/15](https://meta.discourse.org/t/require-category-selection-before-writing-topic/66236/15)

but none of them seem to address this.  
I have `Allow uncategorized topics` unchecked.

---

<div class="post-metadata">

### Author: ![renato](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/renato/32/383632_2.png) [@renato](https://meta.discourse.org/u/renato)
#### Post date: [July 7, 2025, 11:48am UTC](https://meta.discourse.org/t/force-users-to-pick-category/373164/2 "2025-07-07T11:48:56Z")

</div>

Is the issue that a category comes pre-filled? If so, you may be looking for the “Default composer category” site setting.

---

<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: [July 7, 2025, 11:58am UTC](https://meta.discourse.org/t/force-users-to-pick-category/373164/3 "2025-07-07T11:58:15Z")

</div>

> [@renato](#):
>
> Is the issue that a category comes pre-filled?

Yes, that was the issue.

I just Reset that setting and it’s working as expected. Thanks! 🙌

I noticed that when that setting is set to no category, it doesn’t allow the user to click and type and it shows a message to pick a category, but sometimes people don’t immediately read the text. Do you by any chance know if it’s possible to show some “pop up” when the user clicks the message area, before picking a category?

* * *

EDIT: After trying many options that Claude and ChatGPT offered for this, I ended up just removing the “Disabled” property. So users can still click and write their message, but when no category is selected and they try to submit, they see the red/orange error asking to pick a category. This is actually a better behavior, in my opinion.

For others trying to do the same, here’s the Javascript I added to the `<head>` tab in a new component I created called `Unlock Composer`:

```javascript
<script type="text/discourse-plugin" version="0.8">
  const observer = new MutationObserver(() => {
    const textarea = document.querySelector(".d-editor-input[disabled]");
    if (textarea) {
      textarea.removeAttribute("disabled");
      textarea.setAttribute("placeholder", "Select a category before submitting");
      textarea.style.cursor = "text";
    }
  });

  observer.observe(document.body, { childList: true, subtree: true });
</script>

```

> I’m not a developer. This was just what ChatGPT suggested and it works. If anyone sees how this can be improved, please share.

---

<div class="post-metadata">

### Author: ![Rubi](https://avatars.discourse-cdn.com/v4/letter/r/7ea924/32.png) [@Rubi](https://meta.discourse.org/u/Rubi)
#### Post date: [July 7, 2025, 12:30pm UTC](https://meta.discourse.org/t/force-users-to-pick-category/373164/4 "2025-07-07T12:30:01Z")

</div>

Would it be possible to share a screenshot of this in action please.

---

<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: [July 7, 2025, 12:33pm UTC](https://meta.discourse.org/t/force-users-to-pick-category/373164/5 "2025-07-07T12:33:17Z")

</div>

When I click `New Topic`, it shows this:

 ![image](https://global.discourse-cdn.com/meta/original/4X/6/3/b/63b8bdcfd59f02049001c63be285e5e99ca31a23.png)

You can see there’s no default category. Now, I can type my message (unlike the default behavior, which locks the message area), even without a category being selected:

 ![image](https://global.discourse-cdn.com/meta/original/4X/3/b/0/3b0bb9360885c8f3db19e420843ca1b585115110.png)

If I try to submit, I see this:

 ![image](https://global.discourse-cdn.com/meta/original/4X/c/3/3/c33232e565e26de656d549473f80444bd48f78c6.png)

Hope this helps.

---

<div class="post-metadata">

### Author: ![Rubi](https://avatars.discourse-cdn.com/v4/letter/r/7ea924/32.png) [@Rubi](https://meta.discourse.org/u/Rubi)
#### Post date: [July 7, 2025, 12:42pm UTC](https://meta.discourse.org/t/force-users-to-pick-category/373164/6 "2025-07-07T12:42:15Z")

</div>

@alltiagocom excellent, thanks!

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [July 7, 2025, 12:44pm UTC](https://meta.discourse.org/t/force-users-to-pick-category/373164/7 "2025-07-07T12:44:23Z")

</div>

I think this is normally the default behaviour. 🤔 Do you have a topic template set up by any chance?

---

<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: [July 7, 2025, 12:44pm UTC](https://meta.discourse.org/t/force-users-to-pick-category/373164/8 "2025-07-07T12:44:46Z")

</div>

You’re welcome!

I just asked ChatGPT to see if there’s a way to simplify the script a little bit more and it removed the first line, related to the API. I updated my post with the final script, in case you want to use it.

---

<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: [July 7, 2025, 12:47pm UTC](https://meta.discourse.org/t/force-users-to-pick-category/373164/9 "2025-07-07T12:47:21Z")

</div>

No, no template.

 ![image](https://global.discourse-cdn.com/meta/original/4X/e/e/7/ee78e1e2d0ed3ad06e4fdcdb761c78f52c76547d.png)

But I believe this is not the default behavior, because even the original placeholder says something like “Select a category before typing here”, and the cursor changes to an arrow with a 🚫 symbol. It doesn’t allow me to click and type, unless I pick the category.

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [July 7, 2025, 12:51pm UTC](https://meta.discourse.org/t/force-users-to-pick-category/373164/10 "2025-07-07T12:51:41Z")

</div>

> [@alltiagocom](#):
>
> Select a category before typing here”, and the cursor changes to an arrow with a 🚫 symbol. It doesn’t allow me to click and type, unless I pick the category.

That’s what I would expect if you have a topic template set up on one of your categories. Without any set it should allow you to enter the composer text area before setting a category. It blocks it when using topic templates so people don’t accidentally bypass that template by typing in the composer first and then selecting a category.

I’ve just had a quick test run on my site, and with no `default category` or topic templates I can enter the composer area without being blocked until I select a category.

---

<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: [July 7, 2025, 12:55pm UTC](https://meta.discourse.org/t/force-users-to-pick-category/373164/11 "2025-07-07T12:55:11Z")

</div>

Weird… I just disabled the component I created, tried it again, and now it lets me type. It’s not locked 😕

Would it be some cache issue after I set it to `(no category)` or something? Cache on the server itself, because on both Chrome and Firefox, with different user accounts, I got the same behavior. I’m using Cloudflare and I noticed that sometimes there’s issues with my forum that seem to be related with Cloudflare’s cache. Again, I’m no expert, so I’m just guessing…

---

<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: [July 7, 2025, 1:16pm UTC](https://meta.discourse.org/t/force-users-to-pick-category/373164/12 "2025-07-07T13:16:13Z")

</div>

Ok, I think I spoke too soon…  
A few minutes later, it’s back to the other behavior. It’s locked. And when I Inspect the composer, I see this:

 ![image](https://global.discourse-cdn.com/meta/original/4X/6/9/e/69ee1960a4cde1c1ea5ff35dc6c6942b4beb8180.png)

I guess I will just stick to the Component, then.

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [July 7, 2025, 2:06pm UTC](https://meta.discourse.org/t/force-users-to-pick-category/373164/13 "2025-07-07T14:06:02Z")

</div>

> [@alltiagocom](#):
>
> I guess I will just stick to the Component, then.

If it gets it working as you want it to then :chefs_kiss:

Out of curiosity, if you have the [data explorer](https://meta.discourse.org/t/32566?silent=true) plugin installed, could you run this just to see what it says:

```sql
SELECT id as category_id, topic_template
from categories

```

I’ve just been testing this out on another site (which happens to be German as the default locale) and we spotted that there was a cheeky template added to the Uncategorised pseudo category which seems to have caused the same behaviour on that site.

---

<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: [July 9, 2025, 7:30am UTC](https://meta.discourse.org/t/force-users-to-pick-category/373164/14 "2025-07-09T07:30:50Z")

</div>

I just noticed that on the Obsidian forum, the behavior is the same. It’s locked until I pick a category, so it’s probably the new behavior?

I do not have the [data explorer](https://meta.discourse.org/t/32566?silent=true) plugin, sorry.

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [July 9, 2025, 8:14am UTC](https://meta.discourse.org/t/force-users-to-pick-category/373164/15 "2025-07-09T08:14:56Z")

</div>

> [@alltiagocom](#):
>
> so it’s probably the new behavior?

I don’t think so. 🤔 On both recently updated sites I’ve tested this on the behaviour is the same as I’d expect (no `default category` or topic templates = free to type without choosing a category first).

What we couldn’t work out was where the Uncategorized topic template came from on the German locale site. A sneaky auto-added one in there for whatever reason would break the intended functionality without anyone realising.

Do you have one in yours? (And if you could share your `default locale` that would be useful too)

`/c/uncategorized/edit/topic-template`

**ETA:** As an alternative to the date explorer, you can also filter your staff logs to 'topic template’ and see if there’s any extra info in there.

(I’ll also add the filtered link here that Moin shared below)

`/admin/logs/staff_action_logs?filters=%7B%22subject%22%3A%22topic_template%22%7D`

> [@alltiagocom](#):
>
> I do not have the [data explorer](https://meta.discourse.org/t/32566?silent=true) plugin, sorry.

It’s a great plugin, I highly recommend it. 🙂

---

<div class="post-metadata">

### Author: ![Moin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moin/32/554653_2.png) [@Moin](https://meta.discourse.org/u/Moin)
#### Post date: [July 9, 2025, 8:43am UTC](https://meta.discourse.org/t/force-users-to-pick-category/373164/16 "2025-07-09T08:43:23Z")

</div>

> [@JammyDodger](#):
>
> **ETA:** As an alternative to the date explorer, you can also filter your staff logs to 'topic template’ and see if there’s any extra info in there.

I think it’s a little difficult to filter for that in the interface because you can only filter for `actions` and not for `subjects`. There can be a lot of logs for the “change category settings” action. But you can add a subject filter to the URL: `/admin/logs/staff_action_logs?filters=%7B%22subject%22%3A%22topic_template%22%7D`

---

<div class="post-metadata">

### Author: ![Lilly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lilly/32/575047_2.png) [@Lilly](https://meta.discourse.org/u/Lilly)
#### Post date: [July 9, 2025, 10:30am UTC](https://meta.discourse.org/t/force-users-to-pick-category/373164/17 "2025-07-09T10:30:07Z")

</div>

> [@alltiagocom](#):
>
> do not have the [data explorer](https://meta.discourse.org/t/32566?silent=true) plugin, sorry.

i would do yourself a big favor and install it because it is super useful. 🙂

---

<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: [July 9, 2025, 12:42pm UTC](https://meta.discourse.org/t/force-users-to-pick-category/373164/18 "2025-07-09T12:42:11Z")

</div>

> [@JammyDodger](#):
>
> I don’t think so. 🤔 On both recently updated sites I’ve tested this on the behaviour is the same as I’d expect (no `default category` or topic templates = free to type without choosing a category first).

Weird that Obsidian’s forum behaves the same way as mine. Go figure…

> [@JammyDodger](#):
>
> Do you have one in yours? (And if you could share your `default locale` that would be useful too)
> 
> `/c/uncategorized/edit/topic-template`

Also empty. I don’t think I have any templates, actually, anywhere.

 ![image](https://global.discourse-cdn.com/meta/original/4X/4/b/2/4b2a05d32edeba484a6a3bca29e9a8e8d1252552.png)

---

<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: [July 9, 2025, 12:44pm UTC](https://meta.discourse.org/t/force-users-to-pick-category/373164/19 "2025-07-09T12:44:05Z")

</div>

Thank you Lilly (and thank you @JammyDodger) for sharing this plugin.  
Will definitely take a look at it.

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [July 9, 2025, 1:02pm UTC](https://meta.discourse.org/t/force-users-to-pick-category/373164/20 "2025-07-09T13:02:28Z")

</div>

> [@alltiagocom](#):
>
> Weird that Obsidian’s forum behaves the same way as mine. Go figure…

~~I think you should be able to see the default behaviour on [try.discourse.org](http://try.discourse.org), if you’re still curious.~~ No, I was mistaken. Try has a `default category` set.

> [@alltiagocom](#):
>
> Also empty. I don’t think I have any templates, actually, anywhere.

It’s the forgotten ones I was hoping to unearth. 🙂 But if there’s not an auto-added one to Uncategorised then I think this rules out a potential bug, so that’s good. 👍

There’s also the staff logs too (using the link Moin shared), but you seem happy with your workaround so I’ll stop pumping you for more info. 🙂

[Next page](https://meta.discourse.org/t/force-users-to-pick-category/373164.md?page=2)
