Is there a way to hide Seen column?

Some of my users dont like this option:

1 Like

Per user, no we do not have this option, you can suppress it globally via CSS.

3 Likes

If hiding it for all users in an option, this would be the CSS to globally suppress the “last seen” user profile stat:

// Hide the "Last Seen" section of the user profile
.user-main .about .secondary dl div:nth-child(3) {
    display: none;
}
5 Likes

Hi! I am working on a Discourse instance that wants to invite people from various backgrounds and wants to provide a safe, secure and trusting environment.
I am wondering if in the future you would consider having a setting to globally turn off the Seen information (in group lists and anywhere else)? We would like to give a promise to our users that no other user can see when they were last online (i.e. the information is also not accessible when inspecting the html).

If the answer is no, I wonder if you can give advice for how to go about what I mentioned above? I am still quite new to this, so I would like to know if it’s best to hire someone to edit the source code or would a plugin or a component work?

Thank you very much!

I’m not sure about your actual question but this discussion relates to your issue:

It documents the setting that hides the user card:
hide_user_profiles_from_public

3 Likes

Thank you for your comment!
We already hide the user cards, I think that’s a good feature.
However, I am concerned that in the future people in my community will want to hide the “seen” information even from logged in users. So, I just wanted to check what our options are if that time comes.

2 Likes

Sorry for the bump,. but I haven’t been able to find any recent post talking about this. Being able to hide some of the “seen” and “presence” information even from logged in users, as a way to provide more privacy to users.

Are there any new settings to control this? Should we open a feature request?

1 Like

Is it possible to add CSS classes to allow hiding the last seen time for specific users?

I want to hide it for my profile, because people send me messages and then are able to see when I’m last online. It’s just awkward if I don’t reply for a couple of days (not enough time for me to get to everything right away) but they can see that I’m online recently as they repeatedly check my profile, sometimes because I just have a tab open somewhere but am not checking the site.

I believe nobody should expect anyone to do anything just by being present. It’s your life and you have your duties. So I guess it would help to set boundaries, e.g. by writing them in your profile. Like “I am a busy person and I reply to you within a week”. Or “Please only expect me to answer questions about X and Y, for the rest wait for the community”.

So I think it is more of a problem of the other people. Like if they would see you somewhere in real life and rush to you with something very important you have to do right now!

It’s more complicated than that, but I’m not able to explain in detail. The pressure can be immense.

3 Likes

I agree with this. Sometimes I’m the one doing the checking, so I feel jumpy when I know that user is online, but hasn’t replied to me.

1 Like

Not possible with pure CSS, no node path can use your username to target the “last seen” elements.

With javascript, this should work:

<script type="text/discourse-plugin" version="1.4.0">
  function hideLastSeen() {
    if (location.pathname.startsWith("/u/j127")) {
      document.querySelectorAll(".last-seen-at").forEach(el => el.remove());
    }
  }

  api.onPageChange(hideLastSeen);

  document.addEventListener("DOMContentLoaded", hideLastSeen);
</script>

Courtesy of


For future readers, look at the better script below that prevents wrong targeting of users (to avoid targeting user named “johndoe” if using .startsWith("/u/john").

1 Like

Would this stop working with safe mode on?

1 Like

Yes. The admin can disable the safe mode for non-staff if necessary :slight_smile:

2 Likes

But a curious user could still read the info from the json response, right?

1 Like

Yes. As a client side only customization, it’s always a “soft barrier”. Users may or may not be determined (and knowledgeable) enough to exploit this weakness.

2 Likes

Thanks that works.

Edit: I changed it to this to make it case insensitive:

<script type="text/discourse-plugin" version="1.4.0">
    function shouldHideLastSeen() {
        const p = location.pathname.toLowerCase();
        return p === "/u/username" || p.startsWith("/u/username/");
    }

    function hideLastSeen() {
        if (shouldHideLastSeen()) {
            document.querySelectorAll(".last-seen-at").forEach(el => el.remove());
        }
    }

    api.onPageChange(hideLastSeen);
    document.addEventListener("DOMContentLoaded", hideLastSeen);
</script>
1 Like