Hiding YAML in Edit Mode

Use case or problem

YAML appears to have won the battle for the preferred metadata section format. Obsidian is also supporting it more directly with support for aliases. This frontmatter is only going to grow in size - and is potentially in every file.

Unfortunately, the requirement to place the metadata at the top of the text file goes against many design rules by getting in between the meat of note and the interface. As yaml headers expand, the true content of the note will get pushed further and further down and the visual clutter will increase.

Ideally, it would be nice to have the YAML metadata be visible only when you need to access it, and not take front stage for every note at the top of the page.

Similar discussions from other forums:

Proposed solution

A couple of options:

  1. Provide a global hotkey that turns on and off the display of YAML headers that is persistent. That way you can turn it off and forget about it.
  2. Provide a separate YAML editor panel that will move the YAML text out of the primary view (See the discussion here)
  3. Support having the YAML code at the end of the document - this would at least get it out of the way

Current workaround (optional)

Currently I’ve moved all YAML text to the bottom just to get it out of the way. Dataview still supports this, but Obsidian known keys like aliases: will not support it.

Also, you can hide the metadata by switching to the preview mode. Even if you use this as compromise, a WYSIWYG editor will reopen this problem.

Related feature requests (optional)

Thanks for considering this!


I like the idea of a hotkey to collapse/expand YAML in the editor.


I just fold the YAML whenever I need to hide it. As long as Fold indent is enabled in settings, you can fold/unfold a YAML and even set a hotkey


That works great! But I don’t want to fold my indents. So a dedicated “Fold YAML” toggle would be appreciated.


Great feedback @DEV_Scribbles but it is admittedly one more step away from a clean interface - and collapsing also still leaves behind a trigger.

And as to the fact that it is supported on preview mode and why isn’t that sufficient? I would argue (again design aesthetics and usability) that it is in Edit mode that the need for clean space is the most important. It is why iaWriter was successful with its super-clean writer focus mode.

There is something beautiful about starting a new card with it being completely a blank page, ready for filling. Having to see a computer-ese YAML header with metadata fields for every card is a quick mind sucker for creativity.

Of course, just my thoughts on the matter and putting it out there. :slight_smile: Welcome the discussion!


This would be my preference because I don’t want a separate YAML editor panel as that gets confusing and tight on smaller screens and hot keys to turn on and off the display isn’t how I think. I like having the indexing, tags aliases and all the metadata stuff at the end. I can get to it easily if I need to see or edit it but it is toof the way for my normal note use.


I second the global hotkey solution. Putting the YAML frontmatter at the end of the document breaks too much compatibility with other software. Especially when you’re interested to work with stuffs that make it popular. Like static site generators.

1 Like

Use case or problem

Using Obsidian only in Live Preview (thanks for that, loving it!), YAML still looks like the old world.

Proposed solution

The most beloved solution would be an extra YAML-Pane. Short-Term easy solution would be a possibility to hide the YAML-Bloc like in Preview-Mode.


I would love this FR, and there are a few other similar FRs on the forum too

One possibility could be a snippet with the “.is-live-preview” class that hides the YAML section, and then using the Snippet Commands plugin hotkey to activate/disactivate the YAML display as needed.

I would love to learn how to do it, but I wouldn’t wait for me!

I did get this working with this snippet…

/* ====== Hide YAML ======== */
.is-live-preview .cm-hmd-frontmatter {
    display: none;

/* ====== Make the start of the text editor immediately after the banner by not displaying the banner spacer AND banner icon is inline-block ======== */
.is-live-preview .obsidian-banner-spacer {
    display: block;
    margin-top: -50px;

And using the Snippets Commands plugin and Hotkey Helper to hide/reveal YAML using a hotkey.


I also agree with a hotkey solution being preferable. This should be persistent across notes until turned on. To me this is the main hurdle for making obsidian easy to use for taking notes on a phone.