Audience Gate
Restrict sections of a page to specific audience tags with the AudienceGate component.
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.
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:
Visitors whose access token includes the enterprise tag see the section. Everyone else sees the page without it — no placeholder, no gap.
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:
audience, or an empty one, is hidden from every visitor.Multiple Tags
Pass multiple tags separated by commas. The section is visible if the visitor has any matching tag:
Page-Level vs Section-Level Gating
| Frontmatter audience | <AudienceGate> component | |
|---|---|---|
| Scope | Entire page | A section within a page |
| No access | Hidden from navigation, search, and AI; direct URL shows an access page | Section silently removed |
| Navigation | Page absent from sidebar and prev/next links | Page fully accessible |
| Search & AI | Excluded from search results and AI answers | Section left out of search, the page's .md copy and llms-full.txt; AI answers use it only for visitors with access |
| Use case | Client-specific guides, private APIs | Plan-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.
How It Works
<AudienceGate> compiles to a marker in the page HTML. Headings inside the gate get the same marker on their table-of-contents link..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.x-audience-token header)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
<AudienceGate> only when most of a page is shared and a portion is restricted