Ignore tags in main body of notes

I’ve imported 1500 notes from Evernote and the issue I’m having is that the notes contain tags in the body, which Obsidian is picking up as tags. But, a lot of my notes are web clippings and code, in which case the tags shouldn’t be recognised as tags.

Is it possible for Obsidian to only use YAML tags?
Has anyone else had this issue too?

If you’re in a Dataview query you can use file.frontmatter.tags to get the raw list of the tags, and not include the tags in the body of the text. Do note that they now might not have the leading #, and that lists could be either a list or comma separated. It’s really the raw version of the tag.

If you’re in an ordinary Obsidian search, it seems like [tags: yourTag] doesn’t search in the body of the text either. This could be wrong though, so please verify this on your own test data.

Obsidian’s tag index doesn’t differentiate between tags in the YAML/Properties or the body of a note.

You can escape tags so they don’t show up as tags, e.g.

\#not_a_tag

I have lots of CSS notes with hex codes that need to be in code blocks so they don’t show up as tags:

```
--color-cyan: #53dfdd;
```

If either of these don’t work for you or there are too many to change, perhaps a regex Find & Replace? (backup first!)

2 Likes

I know it doesn’t differentiate in the tag index, but there do seem to be a difference when doing a tags property search. And I don’t mind that difference, as I understand the nuances of those searches.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.