How To Hide and Show Elements in Memberstack
Step-by-step guide to hiding and showing Webflow elements based on login status with Memberstack 2.0 data-ms-content attributes.


On membership and marketplace sites, you often need different UI for logged-in users vs visitors. A freelancer profile might show a contact form to members and a "Sign up to contact" CTA to everyone else.
Memberstack 2.0 makes this straightforward with data-ms-content attributes — no custom JavaScript required.
What You'll Need
- A Webflow site with a profile or member page
- Memberstack 2.0 connected to your project
The Pattern: Two Div Blocks
On your profile page, create two wrapper div blocks inside your content section:
- Form logged in — content only members should see (contact form, messaging, portfolio editor)
- Form logged out — content for visitors (sign-up CTA, login prompt)
Name them clearly so you don't mix them up during setup. The names don't affect functionality — they're for your sanity.
Show Content to Logged-In Members
Select the div block that should only appear for logged-in users (e.g. your contact form).
Add this custom attribute:
| Attribute | Value |
|---|---|
data-ms-content | members |
Memberstack checks login status on page load. If the user is logged in, this block renders. If not, it's hidden.
Hide Content from Logged-In Members
Select the div block for visitors (e.g. your sign-up / login CTA).
Add the same attribute with an inverted value:
| Attribute | Value |
|---|---|
data-ms-content | !members |
The exclamation mark inverts the rule — this block shows only when the user is not logged in.
Apply It Across Your Site
This pattern works on any element, not just forms:
- Hide location or portfolio sections from logged-out visitors
- Show premium content blocks only to paying members (plan-level rules work too)
- Gate messaging, reviews, or booking forms behind login
Wrap the section in a div, add data-ms-content="members", publish, and test.
Test Before You Ship
- Publish your Webflow site.
- Log in and confirm the contact form (or member-only block) is visible.
- Log out and reload the same page.
- Confirm the form is hidden and the CTA appears instead.
If both blocks show at once, double-check the attribute values — members vs !members — and make sure attributes are on the wrapper div, not nested incorrectly.
Key Takeaways
- Use
data-ms-content="members"to show content to logged-in users - Use
data-ms-content="!members"to show content to logged-out visitors - Wrap related elements in div blocks so you toggle whole sections at once
- Works with Memberstack plan rules for paid-tier content
- Also supported in Memberstack 1.0 with a similar attribute pattern
Ready to learn more? Check out our Playbooks for step-by-step guidance.
View PlaybooksContinue Reading


