# Making a user's primary group non-visible (eventually) leads to a missing page

**URL:** https://meta.discourse.org/t/making-a-users-primary-group-non-visible-eventually-leads-to-a-missing-page/65261
**Category:** Feature
**Created:** [June 28, 2017, 11:18am UTC](https://meta.discourse.org/t/making-a-users-primary-group-non-visible-eventually-leads-to-a-missing-page/65261 "2017-06-28T11:18:57Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![alehandrof](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alehandrof/32/119526_2.png) [@alehandrof](https://meta.discourse.org/u/alehandrof)
#### Post date: [June 28, 2017, 11:18am UTC](https://meta.discourse.org/t/making-a-users-primary-group-non-visible-eventually-leads-to-a-missing-page/65261/1 "2017-06-28T11:18:57Z")

</div>

I’m guilty of trying something weird. But the system does allow it 😊

All the users in our Discourse are automatically members of groups based on their institutional affiliation (`@myuni.edu` or whatever). I’ve made these institutional groups the “primary” groups. I did this because I’m using the group’s “title” field to convey users’ institutional affiliation.

Here’s what it looks like in a topic:

 ![](https://global.discourse-cdn.com/meta/original/3X/8/4/84b546dc55df1c1dc059b27b84cc29cac57428e7.png)

For various reasons, I don’t want these groups to be visible to users. So I’ve made them hidden them (using the `Group is visible to all users` option).

Unfortunately, when someone clicks on the institution’s name (as shown in the above screenshot) they get taken to a non-existent page (`/groups/myuni` or whatever). I had tested this at some point and I could have sworn that these titles became unclickable if the group was made hidden.

Next steps:

- Do I need to re-bake all the posts (or whatever the Discourse term turns out to be)?
- Otherwise, it would be swell if these titles can be made non-clickable when the group is not visible to users.

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [June 28, 2017, 2:37pm UTC](https://meta.discourse.org/t/making-a-users-primary-group-non-visible-eventually-leads-to-a-missing-page/65261/2 "2017-06-28T14:37:33Z")

</div>

This has come up before. Unfortunately, the only solution at this point seems to be custom code:  
[https://meta.discourse.org/t/apply-css-to-all-custom-non-badge-user-titles/51376/36?u=jomaxro](https://meta.discourse.org/t/apply-css-to-all-custom-non-badge-user-titles/51376/36)

> [@Hidden Group Membership](https://meta.discourse.org/t/hidden-group-membership/62884):
>
> Any suggestions on hiding group membership, even on ones own profile page? Or leaving the names but disabling hyperlink?

---

<div class="post-metadata">

### Author: ![alehandrof](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alehandrof/32/119526_2.png) [@alehandrof](https://meta.discourse.org/u/alehandrof)
#### Post date: [June 28, 2017, 2:54pm UTC](https://meta.discourse.org/t/making-a-users-primary-group-non-visible-eventually-leads-to-a-missing-page/65261/3 "2017-06-28T14:54:21Z")

</div>

Thanks! The JS in your first link solves my problem. But this is kind of a #Contribute > Bug methinks.

---

<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: [June 28, 2017, 10:55pm UTC](https://meta.discourse.org/t/making-a-users-primary-group-non-visible-eventually-leads-to-a-missing-page/65261/4 "2017-06-28T22:55:59Z")

</div>

> [@alehandrof](#):
>
> I’m guilty of trying something weird

So.. don’t do that? Seems pretty expected to me. You made the primary group invisible.

---

<div class="post-metadata">

### Author: ![fhe](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fhe/32/113345_2.png) [@fhe](https://meta.discourse.org/u/fhe)
#### Post date: [March 24, 2018, 4:13pm UTC](https://meta.discourse.org/t/making-a-users-primary-group-non-visible-eventually-leads-to-a-missing-page/65261/5 "2018-03-24T16:13:25Z")

</div>

I don’t find it that weird. Using groups seems to be the standard way of adding custom avatar flairs and if you’re creating the group only for that purpose, having it non-visible makes sense (plus there are probably more reasons to hide a group page, even it is the primary group).

Displaying the group name as a link that results in a permission error doesn’t seem expected to me.
