# Delen van een bericht verbergen

**URL:** https://meta.discourse.org/t/hide-parts-of-a-post/282068
**Category:** Development
**Created:** [12 oktober 2023 om 19:43 UTC](https://meta.discourse.org/t/hide-parts-of-a-post/282068 "2023-10-12T19:43:13Z")
**Posts on this page:** 1
**Showing post:** 2

<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: [12 oktober 2023 om 20:27 UTC](https://meta.discourse.org/t/hide-parts-of-a-post/282068/2 "2023-10-12T20:27:21Z")

</div>

You can combine a few things to achieve this.

1. this theme component: [CSS Classes for Current User's Groups](https://meta.discourse.org/t/css-classes-for-current-users-groups/226068)

2. a little bit of custom CSS in your theme

3. this feature: [Generic bbcode wrapper for theme components](https://meta.discourse.org/t/generic-bbcode-wrapper-for-theme-components/123516)

So for example, if you have a group named `foo`, the theme component (1) will add `.group-foo` to the page for all members of the group.

Then add this custom CSS (2) to your theme:

```scss
body:not(.group-foo) {
  [data-wrap="group-foo-only"] {
    display: none;
  }
}

```

Now you can use a generic bbcode wrapper (3) in a post’s content like this…

```plaintext
[wrap="group-foo-only"]
Only members of the group foo will see this content
[/wrap]

```

So the CSS will hide the wrapped content for anyone that’s not a member of the `foo` group.

Note that this isn’t an entirely secure method to do this, savvy users could use their browser tools or [safe mode](https://meta.discourse.org/t/53504?silent=true) to see this content if they knew what to look for.

If you need a secure method to hide content, you’d need to utilize a feature like whisper posts for staff ([Creating a whisper post](https://meta.discourse.org/t/create-a-whisper-post/44247)) or develop a custom plugin.

---

_[View the full topic](https://meta.discourse.org/t/hide-parts-of-a-post/282068)._
