Exclude known template locations from tag counting

I am making heavy use of templates for different note types, and of course I am using tags in these templates. I’d like Obsidian to not count these tags in the tag overview.

Ideally Obsidian would simply ignore known templates or whole template folders when counting tags.

14 Likes

I think that the template folder would still be good to exclude from the search and display of the graph

3 Likes

Perhaps allowing templates to be put in the .obsidian folder could be a solution? I tried it but the templates weren’t found when I tried to use them.

After talking in the discord. I think the option should be:

Remove Templates from tag search, tag count & Graph. Unless the path:templates is specified.

Specifically for archived, daily, or fleeting notes too depending on the workflow. There are some good suggestions in the thread detailing how to ignore specific folders that could be applied for tags.

Hi,
I am new here - absoluty stunned by this great tool - but templates in Graph View and Tag-Search are “obscuring” everything for me. I’m a bit weirded out by this, as it somehow doesn’t quite fit with the rest of the polished features.

So is there any progress here?

Hi,

I just stumbled upon this post because I had the same problem. It looked especially weird because I’m using Templater to fill in some of the tags, so I had entries full of “<%tp…”.

If you’re using the Templater plugin, there is at least a functional workaround available:

In your YAML header, use Templater to consciously scramble the YAML syntax in one way or the other. Just one syntax error, and your entire YAML header will not count towards tags. Example:

---
tags:
 - MyFirstTag
<%* tR += " -" %> MySecondTag
aliases: <% tp.date.now("DD.MM.YYYY") %>
---

In case you have additional tags within your text, consider replacing the # symbol with a very simplistic Templater string output. Instead of:

`Tags:` #MyTag

Use:

`Tags:` <%* tR += "#" %>MyTag

It doesn’t look nice, but it works (if you’re not relying on the core Templates plugin). :slight_smile:

2 Likes

In fact, it’s a pretty good idea.
To a better things, I do another things : I add tabulation to all frontmatter. So I need to just select the frontmatter, shift+tab and \o/

Hi, I am struggling to implement the mentioned workaround in my YAML front matter to exclude Templater codes from showing up in my Tags panel… can anyone help?

The templater code is:

  • Date/<%tp.file.creation_date (“YYYY”)%>/<%tp.file.creation_date (“MM”)%>/<%tp.file.creation_date(“DD”)%>

I am seeing these in my TAGs panel:

  • <%tp.file.creation_date
  • (“MM”)%>
  • (“YYYY”)%>

Can anyone help?

1 Like

Hi, is there any update regarding the original question of this post?

Excluding arbitrary locations from tag counting as an option in the settings under core-plugin Tags, where then one can specify a list of folders to exclude, would be the most intuitive and flexible solution in my opinion :slight_smile:

Best Regards
El

1 Like

I found a very easy workaroud when usin YAML!

Lets say your template looks like this:

Note Template
---
Tags: Hello
---

The reason it show on your tags is becausa it is in YAML format, sooo… you just have to trick the template to only become YAML when it is used. Like this:

Note Template
<%"---"%>
Tags: Hello
---

Now when you use the template it will “become” YAML and thus, get recognized as a tag!

4 Likes

Thanks @Ulriksen this is exactly what I was looking for.

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