# Hiding users from public view

**URL:** <https://forum.gitea.com/t/hiding-users-from-public-view/112>\
**Category:** Gitea Usages\
**Created:** [November 9, 2017, 4:02am UTC](https://forum.gitea.com/t/hiding-users-from-public-view/112 "2017-11-09T04:02:21Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![demonpig](https://avatars.discourse-cdn.com/v4/letter/d/a88e4f/32.png) [@demonpig](https://forum.gitea.com/u/demonpig)\
**Post date:** [November 9, 2017, 4:02am UTC](https://forum.gitea.com/t/hiding-users-from-public-view/112/1 "2017-11-09T04:02:21Z")

</div>

Out of curiosity, is there a way for me to hide my User accounts from public view? Maybe like a config option?

---

<div class="post-metadata">

**Author:** ![andreynering](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/andreynering/32/41_2.png) [@andreynering](https://forum.gitea.com/u/andreynering)\
**Post date:** [November 12, 2017, 7:15pm UTC](https://forum.gitea.com/t/hiding-users-from-public-view/112/2 "2017-11-12T19:15:30Z")

</div>

I don’t think that’s possible. But you can make a proposal on the issues: [https://github.com/go-gitea/gitea/issues](https://github.com/go-gitea/gitea/issues)

---

<div class="post-metadata">

**Author:** ![demonpig](https://avatars.discourse-cdn.com/v4/letter/d/a88e4f/32.png) [@demonpig](https://forum.gitea.com/u/demonpig)\
**Post date:** [November 13, 2017, 4:02pm UTC](https://forum.gitea.com/t/hiding-users-from-public-view/112/3 "2017-11-13T16:02:38Z")

</div>

Will do. I was thinking about it and it might be possible with templates. Going to test it out this week and see.

---

<div class="post-metadata">

**Author:** ![demonpig](https://avatars.discourse-cdn.com/v4/letter/d/a88e4f/32.png) [@demonpig](https://forum.gitea.com/u/demonpig)\
**Post date:** [November 14, 2017, 11:36am UTC](https://forum.gitea.com/t/hiding-users-from-public-view/112/4 "2017-11-14T11:36:05Z")

</div>

I was able to solve my issue by using a template.

---

<div class="post-metadata">

**Author:** ![jmeile](https://avatars.discourse-cdn.com/v4/letter/j/22d042/32.png) [@jmeile](https://forum.gitea.com/u/jmeile)\
**Post date:** [September 21, 2018, 4:58pm UTC](https://forum.gitea.com/t/hiding-users-from-public-view/112/5 "2018-09-21T16:58:30Z")

</div>

Hi

I know that the thread is old, but could you please tell how you solved this? I’m also interested.

Best regards  
Josef

---

<div class="post-metadata">

**Author:** ![jmeile](https://avatars.discourse-cdn.com/v4/letter/j/22d042/32.png) [@jmeile](https://forum.gitea.com/u/jmeile)\
**Post date:** [September 21, 2018, 5:12pm UTC](https://forum.gitea.com/t/hiding-users-from-public-view/112/6 "2018-09-21T17:12:29Z")

</div>

Nevermind, I figured this out. You need to create the folder: “custom/templates/explore”, then put a file called: “users.tmpl” inside it and now you can customize the user list. Another way would be to customize the “navbar.tmpl” template and remove the Users-Tab. On my case, I’m looking for just hidding the usernames of the admin users; showing the emails is OK.

For customizing other templates not mentioned on the docs, you may have to look for the template here:  
[https://github.com/go-gitea/gitea/tree/master/templates](https://github.com/go-gitea/gitea/tree/master/templates)

then create the folder and its replacement under: “custom/templates”.

Another nice hack if what you want is to hide all gitea pages to the anonymous users is to the the variable: “ **REQUIRE\_SIGNIN\_VIEW** ” to “ **true** ” inside the “**[service]**” section of your gitea’s app.ini file.

---

<div class="post-metadata">

**Author:** ![odigity](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/odigity/32/4827_2.png) [@odigity](https://forum.gitea.com/u/odigity)\
**Post date:** [May 11, 2019, 1:18am UTC](https://forum.gitea.com/t/hiding-users-from-public-view/112/7 "2019-05-11T01:18:03Z")

</div>

Docs: [https://docs.gitea.io/en-us/customizing-gitea/](https://docs.gitea.io/en-us/customizing-gitea/)

---

<div class="post-metadata">

**Author:** ![kctang](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/kctang/32/5942_2.png) [@kctang](https://forum.gitea.com/u/kctang)\
**Post date:** [May 17, 2024, 7:50am UTC](https://forum.gitea.com/t/hiding-users-from-public-view/112/8 "2024-05-17T07:50:38Z")

</div>

I am using custom templates approach described by jmeile (Thanks!). Sharing what I customised here for others to reference.

My requirements:

- Before sign in, cannot explore “Users”. After login, can access.
- Before sign in, can explore “Organizations”. Use case: Public organisation used to publish NPM packages and Docker images so that it can be used without auth.

What makes it work (I’ll not explain the codes as it is quite obvious):

- `href="{{if .IsSigned}}{{AppSubUrl}}/explore/users{{end}}"`
- `{{if or .IsSigned .PageIsExploreOrganizations}}`
- Make sure you are using the templates from correct Gitea version! I am using this: [gitea/templates at v1.21.11 · go-gitea/gitea · GitHub](https://github.com/go-gitea/gitea/tree/v1.21.11/templates). I noticed that main branch is slightly different (and it does not work properly for v1.21.11).

Full templates for `users.tmpl`:

```auto
{{template "base/head" .}}
<div role="main" aria-label="{{.Title}}" class="page-content explore users">
	{{template "explore/navbar" .}}
	<div class="ui container">

        {{if or .IsSigned .PageIsExploreOrganizations}}
            {{template "explore/search" .}}
            {{template "explore/user_list" .}}
            {{template "base/paginate" .}}
        {{else}}
            <!--users listing disabled until logged in-->
            <div>&nbsp;</div>
        {{end}}

	</div>
</div>
{{template "base/footer" .}}

```

Template for `navbar.tmpl`:

```auto
<div class="ui secondary pointing tabular top attached borderless menu new-menu navbar">
	<div class="new-menu-inner">
		<a class="{{if .PageIsExploreRepositories}}active {{end}}item" href="{{AppSubUrl}}/explore/repos">
			{{svg "octicon-repo"}} {{ctx.Locale.Tr "explore.repos"}}
		</a>
		{{if not .UsersIsDisabled}}
			<a class="{{if .PageIsExploreUsers}}active {{end}}item" href="{{if .IsSigned}}{{AppSubUrl}}/explore/users{{end}}">
				{{svg "octicon-person"}} {{ctx.Locale.Tr "explore.users"}}
			</a>
		{{end}}
		<a class="{{if .PageIsExploreOrganizations}}active {{end}}item" href="{{AppSubUrl}}/explore/organizations">
			{{svg "octicon-organization"}} {{ctx.Locale.Tr "explore.organizations"}}
		</a>
		{{if and (not $.UnitTypeCode.UnitGlobalDisabled) .IsRepoIndexerEnabled}}
		<a class="{{if .PageIsExploreCode}}active {{end}}item" href="{{AppSubUrl}}/explore/code">
			{{svg "octicon-code"}} {{ctx.Locale.Tr "explore.code"}}
		</a>
		{{end}}
	</div>
</div>

```

Hope this helps someone.

---

<div class="post-metadata">

**Author:** ![rozmansi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/rozmansi/32/6464_2.png) [@rozmansi](https://forum.gitea.com/u/rozmansi)\
**Post date:** [November 28, 2024, 8:41am UTC](https://forum.gitea.com/t/hiding-users-from-public-view/112/9 "2024-11-28T08:41:21Z")

</div>

Thank you for all your suggestions. The custom template approach does not seem appealing to me for upgradeability reasons. But I did notice `.UsersPageIsDisabled` all over the templates.

According to the source code, the `.UsersPageIsDisabled` is controlled in `conf/app.ini` by:

```ini
[service.explore]
DISABLE_USERS_PAGE = true

```

This setting completely disables browsing users - for visitors or signed-in users. Which is exactly what we need. LDAP authentication brings all our Active Directory users to Gitea and I don’t feel comfortable to make this list explorable.

Repositories and organizations remain explorable. One can still access individual user page, by browsing commits or mocking the URL by guessing a user name.

---

<div class="post-metadata">

**Author:** ![lunny](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/lunny/32/4701_2.png) [@lunny](https://forum.gitea.com/u/lunny)\
**Post date:** [June 15, 2025, 1:25am UTC](https://forum.gitea.com/t/hiding-users-from-public-view/112/10 "2025-06-15T01:25:42Z")

</div>

The user can set it to private to prevent it from being discovered by others through Explore.
