XF 1.4 How to Hide Media Navigation Tab

Hi, just to make it clear I know just enough to be dangerous. ;)

I would like to hide the Media navigation tab completely from non-logged in users and users that are not validated yet.

I have put together this code that I use elsewhere for the purpose of hiding stuff from non-logged in/not validated users:

Template: header
    <xen:if is="!{$visitor.user_id} or {$visitor.user_state} != 'valid'">
            <xen:require css="nav_tab_remove.css" />

nav_tab_remove.css (I created this css)
.navTabs .navTab.resources .navLink {display: none;}
.navTabs .navTab.media .navLink {display: none;}
".navTab.media" does not appear to be it's correct name, does anyone know what the correct name is, or do I need to handle the media tab differently. Thanks.


XenForo developer
Staff member
It seems to me like you should just set permissions for the unregistered / unconfirmed group to not have access to the media gallery.
Thanks Mike, Doh, I did not even notice you could set permissions for Media gallery.

That did the trick.

Appreciate the help as I reckon I would still be going around in circles if someone hadn't pointed it out.
Instead of removing the Media navigation tab altogether, I just want to make it the last item on the navbar. We already have a number of navbar items, and if anything is going to get hidden in a burger menu I'd rather it be Media.

I'm trying to find the code responsible for injecting Media into the navbar, but I'm an amateur and can't find it in Templates > Navigation. Can you point me in the right direction?


XenForo developer
Staff member
At best, you can change the "Navigation Tab Position" option. Otherwise, file/XML changes would be required (which would be overwritten on upgrade).


Well-known member
I need to remove my media tab too. I use custom tabs that say "pictures" and "videos."

I don't use the end position on anything, so I'm OK with commenting that out of the navigation template, but not sure what code to do that to. I tried doing it, but it also erased my sub nav.

What can I comment out?

@Chris D - maybe future suggestion is an option to have no navigation item appear? Or let us choose which categories to appear in nav, but "media" is just not an enticing word to use and doesn't attract many SEO visits.


Active member
What's the best way to hide the Media button in the navbar without disabling the actual gallery itself? I simply want it removed from navigation.