# 取消置顶限制

**URL:** https://meta.discourse.org/t/unpin-restrictions/101393
**Category:** Support
**Tags:** pinned-topics
**Created:** [2018年十一月6日 09:08 UTC](https://meta.discourse.org/t/unpin-restrictions/101393 "2018-11-06T09:08:23Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Kankuro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kankuro/32/123065_2.png) [@Kankuro](https://meta.discourse.org/u/Kankuro)
#### Post date: [2018年十一月6日 09:08 UTC](https://meta.discourse.org/t/unpin-restrictions/101393/1 "2018-11-06T09:08:23Z")

</div>

有什么方法可以防止普通用户取消置顶主题吗？我深知许多论坛滥用置顶功能，这或许就是 Discourse 允许成员取消置顶的原因。但我只想置顶最重要的信息，并希望这些信息保持置顶状态，直到版主或管理员取消置顶。

---

<div class="post-metadata">

### Author: ![dax](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dax/32/244677_2.png) [@dax](https://meta.discourse.org/u/dax)
#### Post date: [2018年十一月6日 09:53 UTC](https://meta.discourse.org/t/unpin-restrictions/101393/2 "2018-11-06T09:53:54Z")

</div>

Sure, you can disable the site setting `automatically unpin topics` that is the setting used to **globally** enable/disable the feature.

---

<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: [2018年十一月6日 10:52 UTC](https://meta.discourse.org/t/unpin-restrictions/101393/3 "2018-11-06T10:52:12Z")

</div>

But users can still click the X and unpin the message right?

---

<div class="post-metadata">

### Author: ![dax](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dax/32/244677_2.png) [@dax](https://meta.discourse.org/u/dax)
#### Post date: [2018年十一月6日 11:11 UTC](https://meta.discourse.org/t/unpin-restrictions/101393/4 "2018-11-06T11:11:44Z")

</div>

Yes, but only if they know that by clicking on the pin icon something changes.

---

<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: [2018年十一月7日 03:04 UTC](https://meta.discourse.org/t/unpin-restrictions/101393/12 "2018-11-07T03:04:21Z")

</div>

Ah! And you know how to hide that button with CSS.

---

<div class="post-metadata">

### Author: ![Kankuro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kankuro/32/123065_2.png) [@Kankuro](https://meta.discourse.org/u/Kankuro)
#### Post date: [2018年十一月7日 03:16 UTC](https://meta.discourse.org/t/unpin-restrictions/101393/13 "2018-11-07T03:16:54Z")

</div>

> [@dax](#):
>
> Yes, but only if they know that by clicking on the pin icon something changes.

Is there a way to prevent this entirely without simply hiding the button with css?

---

<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: [2018年十一月7日 03:21 UTC](https://meta.discourse.org/t/unpin-restrictions/101393/14 "2018-11-07T03:21:22Z")

</div>

Nope. Hide the button with CSS is the only way.

---

<div class="post-metadata">

### Author: ![cosdesign](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cosdesign/32/208585_2.png) [@cosdesign](https://meta.discourse.org/u/cosdesign)
#### Post date: [2021年二月10日 17:30 UTC](https://meta.discourse.org/t/unpin-restrictions/101393/15 "2021-02-10T17:30:24Z")

</div>

这是我使用的代码，适用于除 Staff 和 Team 之外的所有其他群组。  
附：抱歉“复活”了“僵尸”帖子，但其他人可能仍会觉得它有用。

```
body:not(.staff) #topic-footer-buttons .pinned-button,
body:not(.primary-group-team) #topic-footer-buttons .pinned-button{
    display: none;
}

body:not(.staff) #topic-footer-buttons .pinned-button:not(.is-hidden)+.topic-notifications-button,
body:not(.primary-group-team) #topic-footer-buttons .pinned-button:not(.is-hidden)+.topic-notifications-button {
    margin-top: 1em;
}

```
