Tags not returning as tag form in YAML

I have this tag in Yaml

Year: " #-2020 "

It returns #-2020 as result but not in a tag form just psudo text, not sure what i have missed, if i use this tag in Tags: column then it works.

I would like to use lots of tags in Yaml but not just in Tags: column

If you are using a YAML header, you need one of these formats:

tag: meeting

  - recipe
  - cooking

tags: recipe, cooking

Year:  " #-2020 " 

This is the code at the moment, it is valid YAML, my question is how to use tag apart from ‘‘tag’’ title.

1 Like

As @eightning shows how to define tags, he’s also saying that is the way to define/ use them in the frontmatter. There isn’t any other way to define them in other fields.

You can use #tagname outside the frontmatter, in normal text, but inside the frontmatter, it’s only through using the tags field.


I understand your point, i saw an tutorial that shows it can be done.

In the video, this Yaml returns a proper tag, I tried this code on my Yaml, it returns text instead of tag, i am not sure what is missing.

Giving a link to the video might help in debugging.


I haven’t watched it all, but she says she is using Dataview plugin.

Amy has a tag called #status/finished but she also has a separate status key that is duplicating the syntax used in the tag.

For a tag, you need to use the right YAML as Amy does.

This is valid YAML for the tag:

tag: -2020

You don’t need the quotes or hashtag.

I have just tried the same code in Yaml, what she has are working tags in tag section and also status section, but i only have text instead of tag

Tags:   status/finished
Year:  " #status/finished   "

It basically looks like she is only using the hashmark to get autocomplete – but there are other ways of doing that.

No, it can’t be done. I’ve just opened a sandbox vault, and opened up the tags side pane to the right, and entered some of the gibberish she produced in the video:

As can be seen on the right, none of the other fields are actual tags. They look like tags, but they aren’t tags. Why she wants to use that syntax in other fields is beyond me, but they’re not tags in the common sense of the word. Period.

I’m also not sure why she uses that strange string syntax with quotes and spaces, but I’m not going to try to second guess why she’s promoting a tag syntax which clearly isn’t a proper tag syntax.

When turning on the show frontmatter option, the text above produces this output further signalling that the latter three are not real tags:

Another strange syntax which kind of work

In general, it’s not recommended to use the hashtag within the frontmatter, even though she found a quirky syntax which at one point works:

tags: [" #content/blog #content/video "]

But I wouldn’t recommend that either, as it seems to be relying on some esoteric parsing, and not according to the common standards. And even though it looks OK, it doesn’t behave like a proper tag syntax if you view it in the console.log, as it then displays as the text that it is (and not a proper list of tags).

1 Like

It is clear that she has proper tags in other fields than ‘‘tag’’, if you go to video about 11:00, you will see the “status” and also “type” are showing as blue clickable tags, your note is showing the same thing that i am stuck with, but it can be done.

They are not working tags, but if you display this text as part of a query, they display as tags in the query result. But they still aren’t tags which shows up in the metadata, and are available for other queries to use and so on.

This is the same as trying to use links within the frontmatter, you can type something like:

myLink: "[[NoteA]]"

Which isn’t actually a link, but when displayed in various contexts it will behave like a link. In the frontmatter, it’s still just a ‘random’ text. However, when displayed and parsed as markdown it’ll display as link. (Yet again, without actually showing up as backlink in “NoteA”, and none of the other usual behaviour of a link)

Yes, I know of the plugin which kind of makes it into a link

There is a plugin, which tries to emulate the link behaviour, like when renaming other notes also “links” in the frontmatter will be renamed. It’s still not default mechanics, and is just a rather neat addon for those wanting that functionality.

1 Like

I see what you mean, i really hope there is a way to incorporate tag or link system into Yaml, so we can use dataview and the same time benefit from tag and link

What do you mean? You’ve got plenty of room to enter multiple values in tags, or other fields, and the use of / to “divide” a field into a hierarchy is also very possible. It’s just that combination of pretending to use tags within other fields, and the strange list definitions she uses, which is a no-go (for most people).

For some use cases, some would even think it’s viable as it stores the tag to search for in a field for later matching, but I think better options exists. Some of them already highlighted by @eightning in an earlier post.

1 Like

I mean if you want to insert tags in other fields than “tag”
how do you do that?

You don’t! Tags can currently be defined in the frontmatter field of tags:, or using the hashtag syntax in ordinary text. That’s it. Period.

You can insert text containing tags in other fields, but they’re not going to be recognised as tags in the other fields, so they can only be used as some sort of placeholder for a tag.


She’s even commented upon that herself, that the only place to define tags are in the tags: field, and that she uses the others for autocompletion, not for definition.


Thank you!