/Docs
Search docs or ask a question⌘K
DocsAgent
Changelog
Components Audience Gate

Audience Gate

Restrict sections of a page to specific audience tags with the AudienceGate component.

3 min read

The <AudienceGate> component restricts a section of a page to visitors with matching audience tags. Content inside the gate is removed before the page is served — it never reaches visitors without access.

Info

Audience gating is available on every plan. See the Audience Gating guide for full setup — profiles, tokens, and magic links.

Usage

Wrap any block of MDX content in <AudienceGate> with an audience attribute:

mdx
<AudienceGate audience="enterprise">
## Dedicated Infrastructure
Enterprise plans include dedicated infrastructure with reserved capacity.
Contact your account manager to get provisioned.
</AudienceGate>

Visitors whose access token includes the enterprise tag see the section. Everyone else sees the page without it — no placeholder, no gap.

Warning

Leave a blank line after the opening tag and before the closing tag so the content inside is processed as Markdown.

audience can sit anywhere among the gate's attributes (<AudienceGate id="sla" audience="enterprise"> works). Gating fails closed:

•
A gate with no audience, or an empty one, is hidden from every visitor.
•
A gate that is never closed hides everything after its opening tag.
•
Gate tags inside code blocks and inline code are examples, not gates, and are left as written.

Multiple Tags

Pass multiple tags separated by commas. The section is visible if the visitor has any matching tag:

mdx
<AudienceGate audience="beta, enterprise">
## Early Access Feature
This feature is available to beta testers and enterprise customers.
</AudienceGate>

Page-Level vs Section-Level Gating

Frontmatter audience<AudienceGate> component
ScopeEntire pageA section within a page
No accessHidden from navigation, search, and AI; direct URL shows an access pageSection silently removed
NavigationPage absent from sidebar and prev/next linksPage fully accessible
Search & AIExcluded from search results and AI answersSection left out of search, the page's .md copy and llms-full.txt; AI answers use it only for visitors with access
Use caseClient-specific guides, private APIsPlan-specific callouts, beta features

Both can be combined: a page gated to partners via frontmatter can contain an <AudienceGate audience="enterprise"> section visible only to enterprise partners. A visitor needs both: a tag the page allows, and a tag the gate allows. Gates nest the same way.

mdx
---
title: Partner Integration
audience: [partners]
---
# Partner Integration
Content for all partners.
<AudienceGate audience="enterprise">
## Enterprise SLA
Enterprise partners get a 99.99% uptime SLA.
</AudienceGate>

How It Works

1.
At build time, <AudienceGate> compiles to a marker in the page HTML. Headings inside the gate get the same marker on their table-of-contents link.
2.
At build time, gated sections are also left out of the page's .md copy ("Copy page", "Open in ChatGPT/Claude"), llms-full.txt and the search index. Syntext also removes them from every .md copy, llms.txt, llms-full.txt and a changelog's Atom feed as it serves them, for every reader, so sites built before 12 November 2026 don't leak them either.
3.
The AI assistant keeps gated sections apart from the rest of the page, tagged with the tags a visitor needs. Inside a gated page, or inside another gate, only the tags both allow are kept.
4.
At request time, Syntext reads the visitor's audience tags from their access token (cookie or x-audience-token header)
5.
Sections and table-of-contents links the visitor's tags don't match are removed from the response before it is sent — the same stripping removes sidebar links to gated pages

Gated content is never present in what a visitor without access receives — not in the HTML (it can't be revealed via view-source or dev tools), not in the table of contents, the .md copy, llms-full.txt or search results, and not in AI assistant answers. Search results never include gated sections, even for visitors with access.

Best Practices

•
Keep gated sections self-contained — structure the page so it reads naturally with or without the section
•
Headings inside gates are fine — their table-of-contents entries are stripped along with the section
•
Don't gate critical context — pages should make sense to every audience that can reach them
•
Prefer frontmatter gating for whole pages — use <AudienceGate> only when most of a page is shared and a portion is restricted
Was this page helpful? Yes No
Product
Resources
Company
© 2026 SyntextBuilt with Syntext