# Custom Header Links

**URL:** https://meta.discourse.org/t/custom-header-links/90588
**Category:** Theme component
**Tags:** official, custom-header-links
**Created:** [June 24, 2018, 10:22am UTC](https://meta.discourse.org/t/custom-header-links/90588 "2018-06-24T10:22:32Z")
**Posts on this page:** 1
**Showing post:** 196

<div class="post-metadata">

### Author: ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)
#### Post date: [February 25, 2025, 1:29pm UTC](https://meta.discourse.org/t/custom-header-links/90588/196 "2025-02-25T13:29:48Z")

</div>

Hi, welcome!

You can’t do it directly with the component, but you can use CSS to hide links.  
There is a `.anon` class you can rely on to determine whether a user is logged in.

For example, if your link names are “Link 1” and “Link 2”:

```css
/* Logged-out users */
html.anon .link-1-custom-header-links {
    display: none;
}

/* Logged-in users */
html:not(.anon) .link-2-custom-header-links {
    display: none;
}

```

The HTML contains a class name where the link name is dasherized, followed by `-custom-header-links`. You can look at it in the browser console by right click on a link → inspect, you will see:

 ![image](https://global.discourse-cdn.com/meta/original/4X/2/4/9/2496fd86ae8a5aa8f26ffece6a87b0bdcb2974d1.png)

---

_[View the full topic](https://meta.discourse.org/t/custom-header-links/90588)._
