# Is it possible to disable private messaging for a specific user?

**URL:** <https://meta.discourse.org/t/is-it-possible-to-disable-private-messaging-for-a-specific-user/46391>\
**Category:** Support\
**Created:** [2016年六月24日 08:59 UTC](https://meta.discourse.org/t/is-it-possible-to-disable-private-messaging-for-a-specific-user/46391 "2016-06-24T08:59:07Z")\
**Posts on this page:** 13\
**Page:** 2

<div class="post-metadata">

**Author:** ![RBoy](https://avatars.discourse-cdn.com/v4/letter/r/2bfe46/32.png) [@RBoy](https://meta.discourse.org/u/RBoy)\
**Post date:** [2017年六月30日 21:47 UTC](https://meta.discourse.org/t/is-it-possible-to-disable-private-messaging-for-a-specific-user/46391/21 "2017-06-30T21:47:33Z")

</div>

Any update on this feature? I see it’s slated for 1.9 and I know of atleast 1 forum where the Moderator has disabled all PM’s. Am I missing this setting or has it just not made it into Tests Passed yet?

---

<div class="post-metadata">

**Author:** ![Cozdabuch](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cozdabuch/32/139120_2.png) [@Cozdabuch](https://meta.discourse.org/u/Cozdabuch)\
**Post date:** [2017年九月26日 07:14 UTC](https://meta.discourse.org/t/is-it-possible-to-disable-private-messaging-for-a-specific-user/46391/23 "2017-09-26T07:14:55Z")

</div>

This would be a valuable feature.

> [@sam](#):
>
> I support user setting for
> 
> Allow other users to send me private messages.
> 
> I think it is fine, some people do not want to be contacted behind closed doors and it is in no way a prerequisite for participating in a forum

---

<div class="post-metadata">

**Author:** ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)\
**Post date:** [2017年九月26日 07:29 UTC](https://meta.discourse.org/t/is-it-possible-to-disable-private-messaging-for-a-specific-user/46391/24 "2017-09-26T07:29:01Z")

</div>

Already slotted for our next release, we should get to it.

---

<div class="post-metadata">

**Author:** ![Cozdabuch](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cozdabuch/32/139120_2.png) [@Cozdabuch](https://meta.discourse.org/u/Cozdabuch)\
**Post date:** [2017年九月26日 09:40 UTC](https://meta.discourse.org/t/is-it-possible-to-disable-private-messaging-for-a-specific-user/46391/25 "2017-09-26T09:40:44Z")

</div>

Sam, can you build in an exception, or whitelist to get through.  
So say other staff can still send that person messages.

Also, not a user selectable feature, it should be selectable by staff only

---

<div class="post-metadata">

**Author:** ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)\
**Post date:** [2017年九月26日 09:57 UTC](https://meta.discourse.org/t/is-it-possible-to-disable-private-messaging-for-a-specific-user/46391/26 "2017-09-26T09:57:03Z")

</div>

Staff will always be allowed to PM users regardless of what the user opts for.

---

<div class="post-metadata">

**Author:** ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)\
**Post date:** [2017年十月6日 08:58 UTC](https://meta.discourse.org/t/is-it-possible-to-disable-private-messaging-for-a-specific-user/46391/27 "2017-10-06T08:58:04Z")

</div>

I have the initial implementation up @

[https://github.com/discourse/discourse/pull/5226](https://github.com/discourse/discourse/pull/5226)

However, I’m still quite uncertain what we should do about existing PMs with the user in it. Here is what I think should happen for the following scenarios when `User A` disables private messages:

#### PM between `User A` and `User B`

`User B` will not be able to create new replies in the PM

#### PM between `User A` and `Non staff group`

`User B` and members in `Non staff group` will not be able to create new replies in the PM

#### As long as a staff group or user is in the PM

No restrictions on new replies

When I was looking through the code path, I realized that the muted users features have this same problem as well. We only prevent muted users from creating new PMs to the target user but the muted user is still free to add replies to existing PMs.

While I discussed this @sam internally, I’m actually leaning towards adding a feature that allows a user to leave a PM instead. That will allow existing PMs to carry on as per normal without having to handle the above scenarios and add overhead to our `PostCreator` class.

---

<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:** [2017年十月6日 08:59 UTC](https://meta.discourse.org/t/is-it-possible-to-disable-private-messaging-for-a-specific-user/46391/28 "2017-10-06T08:59:00Z")

</div>

Yes we need the “allow people to leave a PM” feature _BADLY_, definitely do that first.

---

<div class="post-metadata">

**Author:** ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)\
**Post date:** [2017年十月6日 10:13 UTC](https://meta.discourse.org/t/is-it-possible-to-disable-private-messaging-for-a-specific-user/46391/29 "2017-10-06T10:13:21Z")

</div>

Implemented in

[https://github.com/discourse/discourse/pull/5226/commits/5dc9d60c0e5673d3320ef513ca6d3286e4d196a7](https://github.com/discourse/discourse/pull/5226/commits/5dc9d60c0e5673d3320ef513ca6d3286e4d196a7)

I’ll wait till next monday to merge it in.

---

<div class="post-metadata">

**Author:** ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)\
**Post date:** [2017年十月6日 23:51 UTC](https://meta.discourse.org/t/is-it-possible-to-disable-private-messaging-for-a-specific-user/46391/30 "2017-10-06T23:51:32Z")

</div>

Was thinking about my implementation last night about leaving a PM, will have to handle a couple more cases as well so that we don’t end up with a PM without any users. Will handle the edge cases next week too.

---

<div class="post-metadata">

**Author:** ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)\
**Post date:** [2017年十月19日 09:19 UTC](https://meta.discourse.org/t/is-it-possible-to-disable-private-messaging-for-a-specific-user/46391/31 "2017-10-19T09:19:23Z")

</div>

This feature has been merged in

[https://github.com/discourse/discourse/commit/22ba70fb01899ad96c933c86a7a9a651c7abd66a](https://github.com/discourse/discourse/commit/22ba70fb01899ad96c933c86a7a9a651c7abd66a)

I placed the setting under “notifications”

 ![image](https://global.discourse-cdn.com/meta/original/3X/4/2/4207f8fc0e2c0257a07386e28942b3fe02c50173.png)

---

<div class="post-metadata">

**Author:** ![RyanK](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ryank/32/297314_2.png) [@RyanK](https://meta.discourse.org/u/RyanK)\
**Post date:** [2017年十一月1日 18:44 UTC](https://meta.discourse.org/t/is-it-possible-to-disable-private-messaging-for-a-specific-user/46391/33 "2017-11-01T18:44:53Z")

</div>

Sorry for the confusion, but this doesn’t override the global site setting right? If I have disabled PM site wide the message button will still only appear to STAFF and won’t be impacted by this setting?

I would love to be able to turn PM on, but either default the optional setting in interface to OFF, or default it OFF for specific group(s).

Is that supported?

---

<div class="post-metadata">

**Author:** ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)\
**Post date:** [2017年十一月1日 19:33 UTC](https://meta.discourse.org/t/is-it-possible-to-disable-private-messaging-for-a-specific-user/46391/34 "2017-11-01T19:33:04Z")

</div>

This will play nice with all your existing settings. Staff always get a free pass.

We are going to add a “default allow private messages” into the user pref section in site settings, just like all the other settings have. cc @tgxworld

Controlling by group is going to require a plugin for now.

---

<div class="post-metadata">

**Author:** ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)\
**Post date:** [2019年三月22日 01:11 UTC](https://meta.discourse.org/t/is-it-possible-to-disable-private-messaging-for-a-specific-user/46391/39 "2019-03-22T01:11:40Z")

</div>



[上一頁](https://meta.discourse.org/t/is-it-possible-to-disable-private-messaging-for-a-specific-user/46391.md?page=1)
