# 如何在插件中添加和移除标签

**URL:** https://meta.discourse.org/t/how-to-add-and-remove-a-tag-in-a-plugin/293632
**Category:** Development
**Tags:** tags
**Created:** [2024 年1 月 31 日 13:24 UTC](https://meta.discourse.org/t/how-to-add-and-remove-a-tag-in-a-plugin/293632 "2024-01-31T13:24:33Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![twofoursixeight](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/twofoursixeight/32/574822_2.png) [@twofoursixeight](https://meta.discourse.org/u/twofoursixeight)
#### Post date: [2024 年2 月 1 日 03:07 UTC](https://meta.discourse.org/t/how-to-add-and-remove-a-tag-in-a-plugin/293632/2 "2024-02-01T03:07:37Z")

</div>

你好。如果你不了解如何使用 Discourse API 并希望学习，请使用此链接来了解如何使用 Discourse API：

> [@Reverse engineer the Discourse API](https://meta.discourse.org/t/reverse-engineer-the-discourse-api/20576?u=twofoursixeight):
>
> Discourse is backed by a complete JSON api. Anything you can do on the site you can also do using the JSON api. Many of the endpoints are properly documented in the [discourse\_api](https://github.com/discourse/discourse_api) gem, however some endpoints lack documentation. To determine how to do something with the JSON API here are some steps you can follow. Example: recategorize a topic. Go to a topic and start editing a category: Open Chrome dev tools, switch to the Network tab, select XHR filter: Perform the op…

---

_[View the full topic](https://meta.discourse.org/t/how-to-add-and-remove-a-tag-in-a-plugin/293632)._
