Search...Search plugins and themes...
⌘K
Sign in
  • Get started
  • Download
  • Pricing
  • Enterprise
  • Account
  • Obsidian
  • Overview
  • Sync
  • Publish
  • Canvas
  • Mobile
  • Web Clipper
  • CLI
  • Learn
  • Help
  • Developers
  • Changelog
  • About
  • Roadmap
  • Blog
  • Resources
  • System status
  • License overview
  • Terms of service
  • Privacy policy
  • Security
  • Community
  • Plugins
  • Themes
  • Discord
  • Forum / 中文论坛
  • Merch store
  • Brand guidelines
Follow us
DiscordTwitterBlueskyThreadsMastodonYouTubeGitHub
© 2026 Obsidian

Preserve Frontmatter Formatting

Michael NaumovMichael Naumov837 downloads

Keeps the formatting of your YAML front matter - comments, quoting, blank lines, indentation and inline lists - when any plugin edits a property.

Add to Obsidian
Preserve Frontmatter Formatting screenshot
Preserve Frontmatter Formatting screenshot
Preserve Frontmatter Formatting screenshot
Preserve Frontmatter Formatting screenshot
  • Overview
  • Scorecard
  • Updates5

Keeps your YAML front matter the way you wrote it when a plugin changes a property. When any plugin edits a property of a note in Obsidian, even through the documented API, Obsidian rewrites the note's whole front matter block. Comments disappear, quotes are dropped, blank lines go, and inline lists such as [a, b] are expanded to one item per line. That happens to every property in the block, including the ones the plugin never touched, and even when it changed nothing at all.

With this plugin enabled, a property change rewrites only the property that changed, and a change that changes nothing writes nothing. It covers every plugin that edits front matter through app.fileManager.processFrontMatter(), which includes some of Obsidian's own edits, and every plugin built on @mnaoumov/obsidian-lib 6.0.0 or later. There are no settings: installing the plugin is the switch, and disabling it gives you Obsidian's own behavior back.

A plugin sets status: done. Left: Obsidian. Right: this plugin

More screenshots
A read-only plugin. Left: rewritten anyway. Right: kept A plugin sets status: done. Nothing else in the note moves The same change without it: comments and quotes gone

Demo vault

The documentation is a demo vault. Its notes explain what changes and why, with buttons that edit a sample note's properties the same way other plugins do, so you can compare the stored text with the plugin on and off.

Start reading here — it is plain markdown, so it works on GitHub with nothing installed.

A copy of the vault ships with every release. You can access it via any of the following:

  1. Running the Preserve Frontmatter Formatting: Open demo vault command.
  2. Downloading preserve-frontmatter-formatting-demo-vault.zip from the Releases. It unzips into a single preserve-frontmatter-formatting-demo-vault-<version> folder.
  3. Browsing its source in demo-vault/ in this repository.

What it does

  • Only the changed property is rewritten. Every other line of the block keeps its exact characters: comments, including the spacing before them, single and double quotes, blank lines, indentation, inline [a, b] lists, and folded or literal text. 01 Edit a property from any plugin
  • A change that changes nothing writes nothing. Obsidian rewrites the block even when a plugin only reads the properties, so a plugin that merely looks at your front matter can reformat it. With this plugin enabled, the note is left as it was. 01 Edit a property from any plugin
  • It covers plugins without their cooperation. Plugins that call app.fileManager.processFrontMatter() are covered by a patch of that method. Plugins built on @mnaoumov/obsidian-lib 6.0.0 or later write front matter through their own copy of the library, and this plugin switches that copy's formatting-preserving mode on for as long as it is enabled.

A value that does change is written in the default style, so a changed quoted string comes back unquoted, the same as Obsidian would write it.

What it deliberately does not do

  • It never makes a note worse than Obsidian would. When it cannot prove that a change can be spliced into the block faithfully, for example because the block uses YAML anchors and aliases, it falls back to Obsidian's own rewrite for that one change, exactly as if it were not installed.
  • It does not cover a plugin that writes the note's text itself, bypassing both routes above.
  • It replaces processFrontMatter() for Markdown files rather than wrapping it, because the formatting is lost inside that method, where a wrapper cannot reach. Another plugin that patched the same method before this one loaded is therefore not called for Markdown files; one that patches it after wraps this plugin as usual.
  • It keeps comments as well as the yaml library can place them, which is not perfectly. That library documents its own comment handling as not completely stable, in particular for trailing comments. Comments on lines the change does not reach are never re-emitted at all, so they are safe. A comment beside a property that is removed or rewritten may go with it.

See also

My other Obsidian resources

Plugin Features How Preserve Frontmatter Formatting differs
yaml-comments Unlisted BRAT starter; restores whole-line comments after processFrontMatter() Same goal as yaml-comments; adds: inline comments, quotes, blank lines, indentation and inline lists; covers obsidian-lib writes

Last searched for similar plugins on 2026-11-22.

Installation

The plugin is available in the official Community Plugins repository.

Beta versions

To install the latest beta release of this plugin (regardless if it is available in the official Community Plugins repository or not), follow these steps:

  1. Ensure you have the BRAT plugin installed and enabled.
  2. Click Install via BRAT.
  3. An Obsidian pop-up window should appear. In the window, click the Add plugin button once and wait a few seconds for the plugin to install.

Debugging

By default, debug messages for this plugin (id: preserve-frontmatter-formatting) are hidden.

If you need to enable them refer to the documentation.

Changelog

All notable changes to this project will be documented in the CHANGELOG.

Contributing

Contributions are welcome — see CONTRIBUTING to get set up.

Support

Filing an issue (for AI agents and humans)

Open issues through the issue forms, not as blank issues.

To report a bug from inside Obsidian, run the Preserve Frontmatter Formatting: Report a bug command. It opens the bug form with the plugin version, the Obsidian version and your operating system already filled in.

Filing from the CLI or the API (gh issue create --body, or an AI agent filing for you) skips the form, and gh issue create --template cannot load an issue form. In that case, open the matching form in .github/ISSUE_TEMPLATE/, copy every field as a ### <label> heading in the form's order, and fill in each one. Always state the plugin version, the Obsidian version and your operating system.

License

© Michael Naumov

HealthExcellent
ReviewSatisfactory
About
Preserve YAML front matter formatting when plugins edit note properties. Rewrite only the changed property and keep comments, quotes, blank lines, inline lists, indentation and folded or literal text exactly as written; write nothing if no change occurs.
PropertiesFormatting
Details
Current version
1.1.0
Last updated
4 weeks ago
Created
2 months ago
Updates
5 releases
Downloads
837
Compatible with
Obsidian 1.14.5+
Platforms
Desktop, Mobile
License
MIT
Report bugRequest featureReport plugin
Sponsor
Buy Me a Coffee
Author
Michael NaumovMichael Naumovmnaoumov
mnaoumov.dev
GitHubmnaoumov
Xmnaoumov
  1. Community
  2. Plugins
  3. Properties
  4. Preserve Frontmatter Formatting

Related plugins

Admonition

Admonition block-styled content.

Advanced Canvas

Supercharge your canvas experience. Create presentations, flowcharts and more.

Linter

Format and style your notes. Linter can be used to format YAML tags, aliases, arrays, and metadata; footnotes; headings; spacing; math blocks; regular Markdown contents like list, italics, and bold styles; and more with the use of custom rule options.

Meta Bind

Make your notes interactive with inline input fields, metadata displays, and buttons.

Editing Toolbar

The Editing Toolbar is modified from cMenu, which provides more powerful customization settings and has many built-in editing commands to be a MS Word-like toolbar editing experience.

Force note view mode

Force the view mode for a note by using frontmatter: YAML block with 'obsidian_ui_mode' as key.

Underline

Add underline with shortcut.

Update modified date

Automatically update a frontmatter modified date field when the file is modified.

Text Format

Format selected text upper/lower/capitalize.

MetaEdit

Manage your metadata.