# Adding many categories

**URL:** https://meta.discourse.org/t/adding-many-categories/198313
**Category:** Support
**Created:** [July 27, 2021, 1:24pm UTC](https://meta.discourse.org/t/adding-many-categories/198313 "2021-07-27T13:24:03Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Jego](https://avatars.discourse-cdn.com/v4/letter/j/7bcc69/32.png) [@Jego](https://meta.discourse.org/u/Jego)
#### Post date: [July 27, 2021, 1:24pm UTC](https://meta.discourse.org/t/adding-many-categories/198313/1 "2021-07-27T13:24:03Z")

</div>

Hello! Some colleagues and me are currently starting a page for my studies, where we want to make one category for each subject. Thus we have to add many many categories. Is there any possibility to automate this like giving Discourse a list with all names for the categories to add?

I am really thankful for every help! Thanks to all and greetings,  
Jego

---

<div class="post-metadata">

### Author: ![awesomerobot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/awesomerobot/32/142900_2.png) [@awesomerobot](https://meta.discourse.org/u/awesomerobot)
#### Post date: [July 27, 2021, 4:11pm UTC](https://meta.discourse.org/t/adding-many-categories/198313/2 "2021-07-27T16:11:32Z")

</div>

We have a guide for doing bulk options from the command line, including exporting/importing categories:

> [@Administrative Bulk Operations](https://meta.discourse.org/t/administrative-bulk-operations/118349#heading--8):
>
> Below you will find a collection of bulk operations that can be initiated from the command line. You will need SSH access, so if you are a hosted customer, you will need to contact the Discourse team about running these commands. warning Before working with the console it is extremely important that you have a recent backup. Mistakes can always happen! First thing to do is enter your site’s container: cd /var/discourse ./launcher enter app Additional Guides: [Performing bulk actions a…](https://meta.discourse.org/t/performing-bulk-actions-as-a-moderator/272832)

I’m not sure how many categories is “many many” but you might run into some performance issues (depending on how the categories are used) once you hit 500+. Using tags instead would avoid that.

---

<div class="post-metadata">

### Author: ![Jego](https://avatars.discourse-cdn.com/v4/letter/j/7bcc69/32.png) [@Jego](https://meta.discourse.org/u/Jego)
#### Post date: [July 27, 2021, 5:30pm UTC](https://meta.discourse.org/t/adding-many-categories/198313/3 "2021-07-27T17:30:35Z")

</div>

Thanks for your reply, I have seen this page. I only see the possibility to import categories from a category file, is this right? Furthermore it appears to be quite difficult to export this file, manually add all categories and re-import it (or is this file different to the category part of the file [https://meta.discourse.org/categories.json](https://meta.discourse.org/categories.json))?

_Edit: Typo_

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [July 28, 2021, 2:49am UTC](https://meta.discourse.org/t/adding-many-categories/198313/4 "2021-07-28T02:49:41Z")

</div>

You’ll want a script that does something like

```
   Category.create(title: "hello".....)

```

A bunch of times, it perhaps reads from a csv or something. You can type just the above with no arguments to get a hint.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [January 17, 2022, 8:59pm UTC](https://meta.discourse.org/t/adding-many-categories/198313/5 "2022-01-17T20:59:02Z")

</div>

You will probably be better off with _tags_ than _categories_.. see

> **[It’s Time We Talked About Tags](https://blog.discourse.org/2017/10/its-time-we-talked-about-tags/)**
>
> Consider the typical sections of a daily newspaper: Arts, Sports, Business, Travel, Local, and World. Any given article belongs to just one of those sections, and the content in each section is quite different, such that some people, for example, may...
