How to turn YAML frontmatter into Confluence labels
Updated 2 December 2026 · 7 min read
Short answer: Confluence has no frontmatter block, but labels do the same job: a Markdown importer reads fields such as tags, owner and status and adds each value as a page label. Confluence labels are lowercase with no spaces and cannot contain characters such as colons, dots or at signs, so values must be sanitized first (Platform Team becomes platform-team). A common convention is one prefix per field, such as owner-sre-team and status-draft, which makes the labels easy to query with CQL.
What is YAML frontmatter, and how does it map to Confluence?
YAML frontmatter is a block of key-value metadata between two --- lines at the top of a Markdown file. Documentation generators and Git-based docs workflows use it to record a title, tags, an owner or a status. Confluence has no equivalent block on a page. Its searchable page-level metadata is labels, so importers map frontmatter fields to labels.
This example file uses the fields Folio for Confluence reads:
---
title: Payments Runbook
owner: SRE Team
status: Draft
tags: [Payments, on-call, "v2.1"]
labels: platform/auth, PCI
---
# Payments Runbook
Folio uses title as the page title, falling back to the first heading and then to the folder or file name. The other four fields become labels. This file produces seven, in this order: payments, on-call, v2-1, platform-auth, pci, status-draft and owner-sre-team. The tags and labels fields accept either a YAML list or a comma-separated string.
What are the Confluence label rules?
Atlassian's help page on labels states that labels do not accept spaces and are lowercase only. Capitals are converted to lowercase automatically, and a space you type is converted to a hyphen.
Other characters are restricted too. An open Atlassian suggestion, CONFCLOUD-6008, lists the characters labels cannot contain: : ; , . ? & [ ] ( ) # ^ * @ ! and spaces. The suggestion was still in Gathering Interest status as of December 2026. That list is why v2.1 cannot be a label as written and why a key-value label such as status:draft has to become status-draft.
Atlassian's current help page does not state a maximum label length. Folio keeps labels to 64 characters as a precaution. Hyphens and underscores are the safe separators.
Every label has its own listing at /wiki/label/<name> on your site, for example /wiki/label/status-draft, and a plus sign combines labels, as in /wiki/label/status-draft+payments.
How does Folio turn frontmatter values into labels?
Folio sanitizes each value with the same rules every time, so a label is not rejected for a character Confluence does not accept:
- Trim the value and lowercase it.
- Turn whitespace,
/,.and:into hyphens. - Remove every other character outside
a-z,0-9,_and-. - Collapse repeated hyphens and trim hyphens and underscores from both ends.
- Cut the result to 64 characters. Drop duplicates, and skip values that end up empty.
| Value in frontmatter | Resulting label |
|---|---|
SRE Team | sre-team |
platform/auth | platform-auth |
v2.1 | v2-1 |
status: draft | status-draft |
#urgent | urgent |
c++ | c |
café | caf |
| A value written only in non-Latin characters | No label (skipped) |
owner: [email protected] | owner-userexample-com |
Five behaviors catch people out:
- Non-ASCII letters are removed. Use plain ASCII for labels. Choose
cppoverc++. - The at sign leaves no separator. An email address becomes a garbled label. Use a team name instead. Labels are visible to anyone who can see the page, so keep personal data out of them.
- Broken YAML does not fail the import. Folio ignores a malformed frontmatter block, records a warning, and imports the page without its labels. Check the YAML before you import.
- Re-imports remove only the labels Folio added. Since version 3.11.0, Folio remembers which labels it put on each page. If you delete a tag from frontmatter, or change
status: drafttostatus: active, the next re-import removesstatus-draftand addsstatus-active. Pages last imported with an older version are tracked from their next re-import, so a conflict created before then needs one manual cleanup. - Labels added by hand are kept. Folio never removes a label it did not add, so a label someone adds in Confluence survives every import.
To find pages with conflicting status labels, for example from imports made with older tools or versions, run this example CQL query:
type = page AND label = "status-draft" AND label = "status-active"
Which owner and status conventions work well?
Give each metadata key its own label prefix, and leave topic tags unprefixed. The prefix keeps the label vocabulary readable and makes queries precise.
| Frontmatter | Label | Meaning |
|---|---|---|
owner: sre-team | owner-sre-team | The team that maintains the page |
status: draft | status-draft | Not ready to rely on |
status: active | status-active | Current and trusted |
status: deprecated | status-deprecated | Kept for history |
tags: [payments] | payments | Topic |
- Use one owner and one status per page, in lowercase with hyphens.
- Name teams, not people. Teams outlast reorganizations of who sits where.
- Keep the status list short and fixed.
status-draftandstatus-activeare the two names Folio's own checks use: when a page cites a Jira ticket that is Done but still carriesstatus-draft, Folio proposes changing it tostatus-activefor you to review.status-deprecatedis an example of a value you can add yourself.
The guide on a labeling scheme for engineering docs covers topic, owner, status and lifecycle labels in more depth.
How do you use labels in CQL, search and Rovo?
Confluence Query Language (CQL) is the search syntax behind Confluence's advanced search and its REST search API. The label field supports the =, !=, IN and NOT IN operators, as listed in the CQL fields reference. These are example queries:
type = page AND space = "ENG" AND label = "status-draft"
type = page AND label = "owner-sre-team" AND label not in ("status-active", "status-deprecated")
type = page AND label in ("payments", "on-call")
The first finds draft pages in one space. The second lists a team's pages that are neither active nor deprecated, which makes a review queue. The third finds pages that carry either topic label.
Rovo needs more care. As of December 2026, an open Atlassian suggestion, ROVO-471, notes that there is no option to filter Confluence knowledge sources for a Rovo agent by label. Do not rely on labels to restrict what an agent reads. Scope the agent by space or page tree, and use labels for human search, CQL and review queues. Folio's read-only get-clean-markdown action returns a page as Markdown together with its labels, so coding agents that read through Folio's MCP tools see them too.
How do other Markdown publishers handle frontmatter labels?
The mapping idea is common, but the re-import behavior differs, and that decides what happens to labels people add by hand and to stale status labels. These details come from each project's README:
| Tool | Where labels come from | On re-publish |
|---|---|---|
| md2conf | The tags front-matter field | Setting tags discards previously assigned labels. Without tags, existing labels are left alone. |
| md2cf | The labels front-matter field | Adds to existing labels by default. The --replace-all-labels option replaces them. |
| mark | Label header comments. Front matter is an optional feature that must be switched on. | The page ends up with exactly the labels named, unless --append-labels is set. |
| Folio for Confluence | tags, labels, owner and status | Adds missing labels and removes the ones it added that the frontmatter dropped. Labels added in Confluence are kept. |
Neither approach is wrong. Replace-style tools keep Git as the single source of truth for labels but erase labels added in Confluence. Add-only tools protect hand-made labels but need a cleanup step when a status changes. Folio sits between the two: Git decides the labels it added, and labels added in Confluence are left alone.
How do you apply frontmatter labels with Folio?
- Add the frontmatter block to each Markdown file, using lowercase ASCII values with hyphens.
- Open Space apps → Folio for Confluence in the target space and choose the Import tab.
- Drop in the folder or
.zip, review the page-tree preview and import. Folio creates the pages first and applies the labels when it publishes each page's final content. - Check the result at
/wiki/label/owner-sre-teamor with a CQL query like the ones above.
Folio works on Confluence Cloud only. Labels are applied as the user who runs the import, using the label write permission Folio requests at install.
FAQ
Can I use key:value labels such as status:draft?
No. Atlassian's list of characters that labels cannot contain includes the colon. Use a hyphen instead, as in status-draft. Folio converts a colon in a frontmatter value to a hyphen for you.
Are tags and labels different in frontmatter?
Not to Folio. It reads both fields and turns every value into a Confluence label. The tags values come first, then the labels values, then the status and owner labels, and duplicates are removed.
Can I label a whole folder of pages at once?
Frontmatter applies to one file, so each file needs its own fields. After the import, the Audit & fix tab in Folio can propose topic labels for unlabeled pages based on their folder and parent page. You review the proposals and apply the ones you want.
Do labels sync back from Confluence into my frontmatter?
Not automatically. Labels flow from Markdown to Confluence when you import. Folio's export writes the current page metadata, including labels, into YAML frontmatter when you run it, but there is no two-way or scheduled sync.