# Hide sidebar from anon users

**URL:** <https://meta.discourse.org/t/hide-sidebar-from-anon-users/250351>\
**Category:** Theme component\
**Tags:** deprecated, sidebar\
**Created:** [January 1, 2023, 11:00pm UTC](https://meta.discourse.org/t/hide-sidebar-from-anon-users/250351 "2023-01-01T23:00:24Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![nathank](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nathank/32/290039_2.png) [@nathank](https://meta.discourse.org/u/nathank)\
**Post date:** [January 1, 2023, 11:00pm UTC](https://meta.discourse.org/t/hide-sidebar-from-anon-users/250351/1 "2023-01-01T23:00:24Z")

</div>

This TC has been deprecated in favour of:

> [@Navigation (sidebar) menu display control](https://meta.discourse.org/t/navigation-sidebar-menu-display-control/277687):
>
> information_sourceSummary Allows displaying sections and links for staff, logged-in and anon usershammer_and_wrenchRepository [https://github.com/Lillinator/navigation-menu-display-control](https://github.com/Lillinator/navigation-menu-display-control)questionInstall Guide [How to install a theme or theme component](https://meta.discourse.org/t/how-do-i-install-a-theme-or-theme-component/63682)open_bookNew to Discourse Themes? [Beginner’s guide to using Discourse Themes](https://meta.discourse.org/t/beginners-guide-to-using-discourse-themes/91966) Install this theme component Description The Navigation Menu Display Control theme component allows for the display of various default…

| | | |
| --- | --- | --- |
| ℹ | **Summary** | Hides the #sidebar from anon users. This is helpful if you have a mostly private site with a small amount of content publicly visible. |
| 🛠 | **Repository** | [GitHub - nathan-nz/discourse-hide-sidebar-from-anon: Hides the sidebar from anonymous users · GitHub](http://github.com/nathan-nz/discourse-hide-sidebar-from-anon) |
| ❓ | **Install Guide** | [How to install a theme or theme component](https://meta.discourse.org/t/how-do-i-install-a-theme-or-theme-component/63682) |
| 📖 | **New to Discourse Themes?** | [Beginner’s guide to using Discourse Themes](https://meta.discourse.org/t/beginners-guide-to-using-discourse-themes/91966) |

Install this theme component

This simple theme component adds in CSS to give a cleaner experience for anon users by hiding the #sidebar.

You might want to do this if (like us) you have a predominantly private site which has one or two categories set to `everyone` (and thus exposed to the internet). It means that casual visitors see a very simple interface that is congruent with the small amount of content they see, while logged in users get the full experience.

This was put together from the code kindly provided by @Don here:

> [@How do I hide the sidebar for anon viewers?](https://meta.discourse.org/t/how-do-i-hide-the-sidebar-for-anon-viewers/250311/2):
>
> Hello, With this you can hide the sidebar for anons. slightly_smiling_face Common / CSS html.anon { // Hide the narrow desktop sidebar // sidebar mobile version which is activate on desktop too under 1000px width .d-header .hamburger-panel { display: none; } // Hide the header cloak when menu opens .header-cloak { display: none !important; } } Desktop / CSS html.anon { // If sidebar opened use the closed style body.has-sidebar-page { #main-outlet-wrapper { …

---

_[View the full topic](https://meta.discourse.org/t/hide-sidebar-from-anon-users/250351)._
