What does the "tag:" search keyword do exactly?

Things I have tried

I have several hashtags in my notes. If I search for one, say #forcethevote, it shows all the instances of the tag in all my notes I think.
However, if I go to the tag bar and click on “forcethevote” I get a search for “tag:#forcethevote
This search returns a narrow subset of the first search.
I’m guessing that some instances of this tag are not being processed into “real tags” in some sense. What is the significance of the “tag:” prefix?

What I’m trying to do

I want to understand how Obsidian “thinks about tags.” I want clicking in my tags bar to show all the corresponding tags and not just some of them.

Do any of the tags that only appear in the text search differ from those in the tag search in any way?

The difference is how Obsidian executes the search, which may impact performance and searching within frontmatter.

When searching for #forcethevote, Obsidian does a full-text search for that exact sequence of letters, and returns a list of pages that contain it.

When searching for tag:#forcethevote, Obsidian searches its internal metadata database for pages that have been tagged with the ‘forcethevote’ tag.

What’s the difference practically?

  • Metadata search is much faster than a full-text search. In a vault with many pages, the performance difference can be noticeable.
  • Full text search may not find tags specified in YAML frontmatter because they don’t necessarily have the # symbol in front of them.


tags: forcethevote

Page content

I hope this helps!



Yes, I find that tags that are expressed or defined in the YAML do not appear in tag: searches. Why would this be?
The tags are there because YARLE put them there… I can probably extract them somehow if I write a script but hopeing to keep them there as what’s the problem? :slight_smile: Thanks

Do you know of any tools that will move the tags from YAML to the main body where a tag: search yields results? And why ignore actually properly formatted tags with #tag format that happen to live in YAML?

I haven’t seen the behavior you’re seeing with regards to searching for tags. In the screenshot below I’m finding notes that have tags defined in their YAML in different ways, and they all show up with a search for tag:#testtag.

Are you maybe defining your YAML tags differently than I am?

1 Like

When you use the “tags” field in YAML you need to leave out the hash mark. In YAML that symbol marks the start of a comment, so your tag fields are effectively empty.

This tag is indexed:

tags: forcethevote

This tag is not:

tags: #forcethevote
1 Like

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