# ゲストのみへのヘッダーリンクの追加

**URL:** https://meta.discourse.org/t/adding-a-header-link-for-guests-only/381546
**Category:** Support
**Created:** [2025 年 9 月 4 日午前 8:52 UTC](https://meta.discourse.org/t/adding-a-header-link-for-guests-only/381546 "2025-09-04T08:52:40Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![Moin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moin/32/554653_2.png) [@Moin](https://meta.discourse.org/u/Moin)
#### Post date: [2025 年 9 月 4 日午前 9:32 UTC](https://meta.discourse.org/t/adding-a-header-link-for-guests-only/381546/3 "2025-09-04T09:32:38Z")

</div>

> [@peternlewis](#):
>
> 公式の[`Custom Header Links`](https://meta.discourse.org/t/custom-header-links/90588)には、この機能がないようでした（何か見落としたのでなければ）。

カスタムCSSを使用して、そのコンポーネントで追加されたリンクをログインユーザーに非表示にすることができます。

> [@Custom Header Links](https://meta.discourse.org/t/custom-header-links/90588/196):
>
> 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”: /\* 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-he…

---

_[View the full topic](https://meta.discourse.org/t/adding-a-header-link-for-guests-only/381546)._
