Obsidian Nested Tags: Search a Parent Tag, Exclude Sub-Tags, or Match Only the Parent

Nested tags look tidy: #status/active, #status/parked, #status/done. Then you search and the results are wrong. tag:#status returns every project, including the finished ones. Excluding one sub-tag makes notes vanish that you expected to see. Searching for #work misses #myjob/work. None of this is a bug. Obsidian's Search treats nested tags in a specific way, and once you know the rules, each of these takes one line to fix. This checklist uses core Search only, no community plugins.

Quick reference

What you want Search term Check
A tag and all its sub-tags tag:#status 1
One sub-tag only tag:#status/active 1
A parent tag but not one sub-tag tag:#status -tag:#status/done (whole notes are dropped) 2
Only the parent, none of its children /#status(?![\w/-])/ 3
A last segment under any parent /#\S+\/work(?!\S)/ 4
Tags written in properties tag: covers them; plain-text regex doesn't 5
A list that stays up to date in a note a query code block 6

☐ 1. Know what tag: matches

Obsidian's help on tags: "In Search, tag:inbox will match #inbox as well as all nested tags such as #inbox/to-read."

The Search help also notes that tag: "ignores matches in code blocks and in non-Markdown content", so it's more accurate than typing #status as plain text.

☐ 2. Excluding a sub-tag removes the whole note

Search terms can be negated with a hyphen, so tag:#status -tag:#status/done reads as "has a status tag, and isn't done". That works, as long as you remember that tag: looks at the whole note, not at a line.

If a note can legitimately carry both an "active" and a "done" status, that's usually a sign the tag should move to one place, such as the note's properties, so each note has exactly one status.

☐ 3. Match only the parent, not its children

There's no built-in "this tag but none of its sub-tags" option, and regular expressions can't go inside tag: (Obsidian answers "operator 'tag' can only be followed by text", as a forum moderator confirmed). A plain-text regular expression works instead. The Search help: "To use regular expressions in your search term, surround the expression with forward slashes", and Obsidian uses JavaScript-flavoured regular expressions.

/#status(?![\w/-])/

Note: \w covers only A–Z, a–z, 0–9 and underscore. If your tags use accented letters or other scripts, a tag like #statusé would match too. Check with Explain search term in the search settings.

This is a full-text search, so unlike tag: it also matches text inside code blocks.

☐ 4. Find a last segment under any parent

tag:#work won't find #myjob/work. To find a segment wherever it sits in the hierarchy:

/#\S+\/work(?!\S)/

Note: like check 3, this reads note text, so tags that only appear in properties aren't found this way (see check 5).

☐ 5. Tags in properties

Obsidian's help: you can add tags with the tags property, and "Tags in YAML should always be formatted as a list".

---
tags:
  - project
  - status/active
---

If you mix body tags and property tags, tag: is the one operator that covers both.

☐ 6. Save the search as a live list in a note

The Search help: "To embed search results in a note, add a query code block". This works well for a dashboard note:

```query
tag:#status/active -tag:#status/done
```

☐ 7. Colour the graph by tag

Graph view groups use the same search terms. In the graph settings, under Groups, click New group, type a search term such as tag:#status/active, and pick a colour.

Symptom table

Symptom Likely cause Check
tag:#status returns finished projects Parent matches all sub-tags 1, 3
#work search misses #myjob/work tag: matches from the start of the tag 4
Notes disappear after -tag:#x/y Exclusion is note-level 2
Regex typed inside tag: gives an error or no results Regex isn't supported inside tag: 3
Regex finds nothing for some notes Tags live in properties, without # 5
Graph colours gone after an update Graph settings issue; reset after backing up 7

A vault with a tag convention already in place

Indie Weekly ($39) is a ready-to-open Obsidian vault for indie developers. According to its product page, it has 41 Markdown notes, including a Home dashboard, a getting-started guide, a tag convention note and filled examples, plus 8 templates: weekly review with a next-week plan, ship log, daily log, metrics snapshot, project, idea, decision and experiment. Its tag convention note uses one tag per note type (#weekly, #ship, #project, #decision and so on) and nested #status/active, #status/parked and #status/done tags for the project lifecycle, and the graph comes with colour groups for the main note types. It uses core Obsidian settings only, so no community plugins are needed. It's made for Obsidian desktop; mobile hasn't been tested yet. If you only want the two core templates, Indie Weekly Lite is free: it has the Weekly Review and Ship Entry templates, without the other 6 templates or the full 41-note vault.

Sources