# Reserved usernames programmably?

**URL:** <https://meta.discourse.org/t/reserved-usernames-programmably/278906>\
**Category:** Support\
**Created:** [September 13, 2023, 5:05pm UTC](https://meta.discourse.org/t/reserved-usernames-programmably/278906 "2023-09-13T17:05:56Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)\
**Post date:** [September 14, 2023, 1:35am UTC](https://meta.discourse.org/t/reserved-usernames-programmably/278906/5 "2023-09-14T01:35:21Z")

</div>

> [@lejeczek](#):
>
> Is it possible to manage ‘reserved usernames’ programmably?

Yes, I did this once for a site that had a huge list of reserved usernames. As long as you are aware of the risks of using the Rails console, you can enter it by going to the `/discourse` directory in your server and running:

```plaintext
./launcher enter app
rails c

```

From the prompt that appears, run:

```plaintext
SiteSetting.reserved_usernames

```

You should see output similar to this:

```plaintext
"admin|moderator|administrator|mod|sys|system|community|info|you|name|username|user|nickname|discourse|discourseorg|discourseforum|support|all|here"

```

That’s the setting’s default value. You will probably want to add the default list to your custom list. Make sure that the entire list is surrounded by quotation marks, **with each item separated by a pipe character** (`|`)

Then run:

```plaintext
SiteSetting.reserved_usernames="your|reserved|usernames"

```

Replace `your|reserved|username` with your actual list of usernames.

Exit the Rails console by typing `exit` at the prompt.

---

_[View the full topic](https://meta.discourse.org/t/reserved-usernames-programmably/278906)._
