# 如何查找帖子ID？

**URL:** https://meta.discourse.org/t/how-do-you-find-a-post-id/151905
**Category:** Support
**Created:** [2020年五月19日 05:15 UTC](https://meta.discourse.org/t/how-do-you-find-a-post-id/151905 "2020-05-19T05:15:09Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![Jennifer\_Abrams](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jennifer_abrams/32/150388_2.png) [@Jennifer\_Abrams](https://meta.discourse.org/u/Jennifer_Abrams)
#### Post date: [2020年五月19日 05:15 UTC](https://meta.discourse.org/t/how-do-you-find-a-post-id/151905/1 "2020-05-19T05:15:09Z")

</div>

需要永久删除帖子，请使用

```plaintext
Post.find(THE_POST_ID).destroy

```

谢谢，这很重要。

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [2020年五月19日 06:39 UTC](https://meta.discourse.org/t/how-do-you-find-a-post-id/151905/2 "2020-05-19T06:39:13Z")

</div>

你为什么试图“永久删除”帖子？简单地删除帖子记录会导致悬空指针，造成数据库损坏，而且你可能无法捕获帖子内容的所有副本（尤其是修订版本）。

如果帖子中包含需要清除的非法内容，我相信我有相关的操作说明。

---

<div class="post-metadata">

### Author: ![Jennifer\_Abrams](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jennifer_abrams/32/150388_2.png) [@Jennifer\_Abrams](https://meta.discourse.org/u/Jennifer_Abrams)
#### Post date: [2020年五月19日 06:43 UTC](https://meta.discourse.org/t/how-do-you-find-a-post-id/151905/3 "2020-05-19T06:43:23Z")

</div>

> [@riking](#):
>
> 如果帖子中有需要清除的非法内容，我相信我有相关操作说明。

内容并不违法，但我不希望它出现在我的服务器上，该怎么做呢？

---

<div class="post-metadata">

### Author: ![Jennifer\_Abrams](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jennifer_abrams/32/150388_2.png) [@Jennifer\_Abrams](https://meta.discourse.org/u/Jennifer_Abrams)
#### Post date: [2020年五月19日 06:45 UTC](https://meta.discourse.org/t/how-do-you-find-a-post-id/151905/4 "2020-05-19T06:45:24Z")

</div>

不是图片，只是文字

---

<div class="post-metadata">

### Author: ![Jennifer\_Abrams](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jennifer_abrams/32/150388_2.png) [@Jennifer\_Abrams](https://meta.discourse.org/u/Jennifer_Abrams)
#### Post date: [2020年五月19日 06:46 UTC](https://meta.discourse.org/t/how-do-you-find-a-post-id/151905/5 "2020-05-19T06:46:03Z")

</div>

顺便说一下，我找到了帖子 ID。

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [2020年五月19日 06:46 UTC](https://meta.discourse.org/t/how-do-you-find-a-post-id/151905/6 "2020-05-19T06:46:42Z")

</div>

如果您只是不想让它出现，且它并未造成技术或法律上的问题：

- 点击界面上的“删除帖子”按钮
- 使用您的管理员权限编辑已删除的帖子，将其内容改为“（内容已被管理员移除）”
- 如有必要，可向发布该帖子的用户 [发送正式警告](https://meta.discourse.org/t/discourse-moderation-guide/63116)

---

<div class="post-metadata">

### Author: ![Jennifer\_Abrams](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jennifer_abrams/32/150388_2.png) [@Jennifer\_Abrams](https://meta.discourse.org/u/Jennifer_Abrams)
#### Post date: [2020年五月19日 06:47 UTC](https://meta.discourse.org/t/how-do-you-find-a-post-id/151905/7 "2020-05-19T06:47:48Z")

</div>

有没有办法在数据库里重写它？看到它在那里，我精神上真的很痛苦。

---

<div class="post-metadata">

### Author: ![Jennifer\_Abrams](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jennifer_abrams/32/150388_2.png) [@Jennifer\_Abrams](https://meta.discourse.org/u/Jennifer_Abrams)
#### Post date: [2020年五月19日 06:52 UTC](https://meta.discourse.org/t/how-do-you-find-a-post-id/151905/8 "2020-05-19T06:52:47Z")

</div>

有人对我说了过于激烈的言辞，所以我打算删掉它并警告他，毕竟我不想让数据库出问题。

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [2020年六月18日 07:05 UTC](https://meta.discourse.org/t/how-do-you-find-a-post-id/151905/9 "2020-06-18T07:05:07Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
