Hide Footer Links From Logged Out Users

Topic summary

A user wants to hide specific footer links from visitors who aren’t logged in to their Shopify Plus store.

Proposed Solution:
Another participant confirms this is achievable using Liquid conditional logic, though notes the syntax can be tricky due to limited control over operation order with and/or statements.

Implementation Approach:

  • Use conditional logic to check customer login status
  • Target specific links by their handles (e.g., ‘x’, ‘y’, ‘z’)
  • Set a show_link variable to control visibility
  • The logic should default to hiding links (show_link = false) when the customer is not logged in AND the link matches certain handles

Status:
Pseudo code examples were provided but noted as untested. The discussion appears to offer directional guidance rather than a finalized solution. The code snippets show two potential approaches with varying levels of compactness.

Summarized with AI on November 13. AI used: claude-sonnet-4-5-20250929.

Hi there,

I’d like to hide footer links from those who are not logged in. Is there a way to make them only visible to logged in users?

Here is the site: https://wholesale.harrisvilledesigns.com/

This is definitely doable. The conditional logic can be a little tricky to get your head around—especially since liquid doesn’t provide much conrol over order of operations with and/or in if statements.

Here’s some potential speudo code showing how you might do it. This has not been tested so I am not 100% sure if it’s exactly right but hopefully it points you in the right direction.

{%- for link in menu.links -%}
{%- liquid
  assign show_link = true

  if link.handle == 'x' or link.handle == 'y' or link.handle == 'z'
    unless customer
      assign show_link = false
    endunless
  endif
-%}
{%- if show_link -%}
    <li>…</li>
{%- endif -%}
{%- endfor -}

You could also tighten it up to be like this but it’s a little harder to understand the code:

…
if customer == false and link.handle == 'x' or link.handle == 'y' or link.handle == 'z'
  assign show_link = false
endif
…
1 Like