AArlert1k downloadsAutomatic heading numbering with fully customizable templates, per-folder rules, whitelist and backlink sync. Bilingual UI (English / 中文).
English | 简体中文
Automatic heading numbering for Obsidian — the kind that survives editing, renaming, and reorganizing your notes.
You insert a section in the middle of a long document, and now every number after it is wrong. Manually renumbering 2.3 → 2.4 → 2.5 … across a 40-heading spec or a semester's worth of lecture notes is tedious and error-prone. Auto Headings recomputes the whole file automatically, every time you stop typing.
You rename a numbered heading, and every [[note#heading]] or [label](note.md#heading) link pointing at it breaks. Most numbering plugins only touch the number and leave the link text stale. Auto Headings' backlink sync rewrites both Wikilinks and Markdown links across your vault in the same edit — rename the text, not just the number, and links still resolve.
One numbering style never fits your whole vault. Meeting notes want 1 / 1.1 / 1.1.1. A book manuscript wants 第一章 / 一、. An academic paper wants to skip "Contents" and "References" from the count entirely. Auto Headings lets every folder — even every file — use its own template, with a whitelist for the headings that shouldn't be numbered at all.
Install it and you get 1 / 1.1 / 1.1.1 numbering the moment you edit a note — zero configuration. Then customize as much or as little as you need.
Everything below is what you get the moment the plugin is enabled, before you open the settings panel once.
1 / 1.1 / 1.1.1 numbering the moment you edit — no setup needed.#/##/###. Multiple top-level # H1s in one file are left alone and treated as section boundaries (numbering under each one restarts).Ctrl/Cmd+Z undoes it, and your cursor position is preserved.obsidian-auto-headings: true or false to a note's frontmatter to override that toggle for one file — force it on while everything else stays untouched, or force it off for a file you don't want the plugin near. The Renumber now command ignores both: typing a command is explicit enough intent to skip every switch and renumber immediately.isDesktopOnly: false).Tab (or tap on mobile) and your text is expanded to the heading's full name as a clickable link to that heading. Also on by default, and it works for already-numbered headings too.obsidian-auto-headings: true/false in frontmatter to force-enable/disable a single file. The command Renumber now bypasses all switches.Once the defaults aren't enough, this is what you reach for.
Most heading-numbering plugins update the number but leave stale link text behind. This one keeps them in sync.
<!-- note.md, before -->
## 1 Foo
<!-- other.md -->
See [[note#Foo]] for details.
See [the same section](note.md#Foo) in Markdown-link style.
You edit the heading — text, not just the number:
<!-- note.md, after -->
## 2 Foobar
The reference updates itself, automatically, in the same edit:
<!-- other.md -->
See [[note#Foobar]] for details.
See [the same section](note.md#Foobar) in Markdown-link style.
No broken anchors, no manual find-and-replace across your vault. The approach builds on Header Enhancer, the only other plugin that tackles this problem, with several targeted improvements layered on top — atomic writes so an interrupted update can't half-corrupt a file, safer handling of duplicate headings, and more. (A few edge cases — duplicate heading names, block references, multi-level anchors — are left untouched on purpose; see Notes.)
On by default, with a one-time explanatory notice the first time it actually rewrites a link. Can be turned off in Settings → General if you'd rather manage links yourself.
Every heading level (H1–H6) has independent control over:
第1章)1), Chinese (一二三), circled (①②③), lowercase/uppercase letters, lowercase/uppercase Roman numerals. in 1.1) and title separator (the space between the number and your heading text)1.1.1); turn it off for a level to show only that level's own numeral (e.g. a) instead of 1.a))一、二、, H2 starts its own 1, and H3 picks up only its H2 parent for 2.1 — without dragging H1 into the prefix. Getting that middle ground used to mean pushing the start level deeper, which cancelled H1's numbering along with it1.a.①). Chinese-book style wants the opposite: the chapter heading itself reads 一, but drops to Arabic the moment it becomes an ancestor inside a section number (一 at H2, 1.1 at H3). A single numeral setting can't satisfy both directions at once, so ancestorNumeral controls just the ancestor segments, independent of how a level renders on its own.All of it previews live as you type, so you see the exact heading format before it's ever written to a file. Create as many named templates as you like (rename, edit, or delete them from the settings panel).
A path-rule table maps folders and individual files to a named template, most-specific match wins (a file-level rule beats its parent folder's rule). Use academic numbering in /papers, chapter-style numbering in /book, and the default 1 / 1.1 everywhere else — all in the same vault, no manual switching. The rule table supports drag-to-reorder, path autocompletion from your actual vault structure (browse folders level by level, or type to fuzzy-search), and warns you if you haven't set a root (/) fallback rule while global auto-numbering is on.
Two rule-level tools round this out: pick the pseudo-template "No numbering" to switch numbering off for a whole folder (no more per-file frontmatter flags — existing numbers are left frozen, not stripped), and use the per-rule batch renumber button to renumber every file the rule matches in one confirmed action (each file uses its own effective template; files opted out via frontmatter or containing foreign numbering are skipped).
Headings like "Contents", "Appendix", or "References" shouldn't get a number and shouldn't consume a slot in the counter. The whitelist (configured per template) handles this with three match modes:
Resetting the counter after a subtree block, rather than continuing where it left off, is the default behavior, not a setting you have to find — a survey of academic and technical citation conventions (APA, Chicago, IEEE, RFC, GB/T 7714) found that roughly 85% of them break numbering after an appendix-like block and restart afterward.
The default template ships pre-populated with common structural terms in both English and Chinese (Contents, Appendix, Figures, Tables, References, Acknowledgments, Abstract, Index, and their Chinese equivalents).
The editor itself is built for quick tweaking, not just a flat list:
= exact / ≈ partial / ▸ subtree) right on the row — one click to switch, with a bilingual tooltip explaining each iconThe whitelist matches on heading text, so it handles "this kind of word". When what you need is "this
one line, in this one note" — say a "Scratch notes" heading that shouldn't be numbered here, while the same
word is a real chapter elsewhere — append <!-- skip --> to the end of that heading line:
## Scratch notes <!-- skip -->
It's invisible in reading view. A skipped heading doesn't consume a counter slot, so the headings after it stay consecutive. Add the marker to a heading that already has a number and the next renumber removes that number. For now it affects only the line it's on, not the headings nested under it.
This is a fallback for the occasional one-off line, not the everyday path — use the whitelist to exclude a whole class of words. A one-click toggle next to the heading is planned, so you won't have to type it.
obsidian-auto-headings: false into its frontmatter) — otherwise your very next keystroke would put the numbers straight back. To hand the file back to the plugin, run Renumber now; it removes that property for you1. prefixes, imported document numbering, etc.) while leaving the plugin's own numbering untouched — the tool for taking over a document you didn't originateTo tell its own numbering apart from your text, the plugin ends every prefix with an invisible Word Joiner character (U+2060): ## 1 My heading. This is what makes it safe — headings that merely look numbered (2024 Review, API design) are never mistaken for old numbering and eaten.
The idea of marking prefixes with an invisible Unicode character traces back to gurjar1/auto-heading-obsidian. This plugin adds a second safeguard on top of it: since 0.7.20 the marker sits at both ends of the prefix, not just the end. If you delete the trailing one while editing — say, trimming a suffix — the leading one survives as proof a plugin prefix was there, so the next renumber heals the line instead of either duplicating the number or guessing wrong.
What this means for you:
grep your files for exact heading text, be aware it sits between the number and the title — searching for "1 My heading" as one contiguous string will not match.section (on TASK/LIST queries), through link subpaths, and through the metadata cache in DataviewJS — all of which carry this character. The simplest fix is to stop matching exactly: the numbering is always a prefix, so endswith(section.subpath, "My heading") just works with no escaping. Recipes for normalizing (and a correction: Dataview has no file.headers field, contrary to what this README used to claim) are in the marker character contract..replace(/\u2060/g, "") in the destination app.The numbering is real text, so it travels with your documents. Where each egress path stands:
--number-sections yields double numbering like 1.1 1.1 Introduction. Drop the ready-made filter assets/pandoc/strip-autoheadings.lua into your pipeline: by default it removes the plugin's prefixes so --number-sections produces clean single numbering, and -M autoheadings=strip-marker instead keeps the plugin's numbers and removes only the invisible character. Either way inline formatting inside headings (bold, code, links) survives. Verified against pandoc 3.10.--pdf-engine=typst produced no U+2060 anywhere in the PDF text layer — even without the filter, the marker is dropped before it reaches the page. Copy and search in the resulting PDF behave normally. Other PDF engines are untested.From the community plugin store: already listed and searchable — Settings → Community plugins → Browse → search "Auto Headings", then install and enable directly. It has passed the store's automated checks; Obsidian's manual/editorial review is still pending (this doesn't affect installing or using the plugin).
Manually: download main.js, manifest.json, styles.css from the latest release into <vault>/.obsidian/plugins/auto-headings/, then reload Obsidian and enable the plugin.
Number Headings has been unmaintained for roughly 2.5 years. Migrating takes three steps:
1.1.1 is close to its style; path rules can assign different templates per folder);Its two longest-standing open requests are both implemented here: excluding folders from numbering (pick the "No numbering" pseudo-template on a path rule) and skipping headings inside comment blocks (%%…%% and <!-- --> are ignored — not numbered, and they don't consume a counter slot either).
| Command | What it does |
|---|---|
| Renumber now | Renumber the current file immediately, bypassing all switches |
| Clear numbering in current file | Strip all numbering prefixes (including hand-written ones) |
| Clean foreign numbering | Strip only numbering not written by this plugin — use it to take over imported documents |
^id), multi-level anchors (#A#B), external URLs, and Markdown-looking text inside inline/fenced code. Turning the sync on doesn't retroactively fix links that were already broken before it was enabled. It can also be turned off in Settings → General.Ctrl/Cmd+Z undoes them. Backlink updates to other files are not part of that transaction. The vault-wide clear is not in the undo history; back up first.isDesktopOnly: false).The only things this plugin ever writes into your files are numbering prefixes and two invisible marker characters — all fully removable. Two ways out, depending on whether you want to keep the numbers:
Drop the numbering — Settings → sensitive operations → Clear numbering in entire vault (it first switches global auto-numbering off, so nothing gets renumbered mid-clear). Headings go back to bare text.
Keep the numbering — Settings → sensitive operations → Freeze numbering and release ownership. Every number stays exactly as it is, as ordinary text; only the invisible markers go, and the plugin stops numbering anything from then on. This is the one to use if you like your current numbering but no longer want a plugin managing it, or you're uninstalling and want to keep the result. Markers are removed vault-wide including inside link anchors, so your [[note#heading]] links keep resolving. Once frozen, the plugin can no longer tell those numbers were its own — that's the point, but it does mean the step is one-way: to hand control back, re-enable it and run Clean foreign numbering first, or the existing numbers get a second prefix stacked on top.
Then:
obsidian-auto-headings keys from frontmatter — they're inert without the plugin.Because the marker lives in the file bytes themselves, even years after uninstalling you can reinstall the plugin and run the vault-wide clear to strip its old numbering precisely; for external batch cleanup without reinstalling (a one-liner), see the marker character contract.