Tags Management in Logseq. How?

How do you guys manage tags? How do you keep track of maybe similar-meaning tags that you have tagged some piece of information with and when you query you don’t query by all similar tags that might have the same meaning? With such a permissive app like Logseq one can end up with thousands of tags that you can’t even remember to ever have used. I’ve seen some posts about hierarchies for tags but those seem quite complicated for me and all use pages to host properties in the form of relates-to:: and the like.
I myself am using almost exclusively blocks and my “pages” are 99.95% just wikilinks to tags. Moreover, I am trying to keep some compatibility with outside-Logseq world and also keep hashtags close even if I am using Logseq Internal Links ([#tag]([[tag]]) or [alias]([[tag]] "#tag")).
I really need a way to have some order in my Tags and to be frank I have no idea how that can be achieved. Ideally the Graph should be a good representation of my Tags Cloud and Tag Connections but I can’t seem to make good use of it or merely understand what’s going on there. Sometimes I find it quite unintuitive.

What are your approaches to get a bird-view of your tags?

1 Like

Very unhelpful answer: I don’t.
I use a very limited amount of tags so keeping track is a non-issue for me.
Eh, well for the limited amount in terms of organisation that is. I use plenty tags without organisation intend.
I use P.A.R.A to organize my graph. So for everything I write I consider in which project or area it falls and tag it with that for organization. Sometimes it’s a sub area. (For example I will use the games tag and not the hobby tag.)
If I record that I’ve used the logseq forum I would tag it with social. Even though social as a tag is not otherwise organized.
Guess I’m just good at using consistent tags lol.

That all to say that I also do have queries to get information on what pages I have and if they are organized as I wish. But I limit my queries to pages that actually have content (so a file).

Here is a query. It excludes some pages right now, but you can add or subtract from the contains? list as needed.
You can add [?p :block/file _] to limit it to only files, but I don’t think that is useful as I understand from your use case.
I also excluded block references. I had some (but not all??) show up in my results :thinking:

{:title [:h3 "All pages"]
 :query [:find (pull ?p [*])
   [?p :block/journal? false]
   [?p :block/name ?n]
   (not [(contains? #{"TODO" "DOING" "DONE"} ?n)])
   [(re-pattern "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}") ?regex]
   (not [(re-find ?regex ?n)])
 :result-transform (fn [result] (sort-by (fn [r] (get r :block/name)) result))
 :view (fn [result] (for [r result] [:a.tag.mr-1 {:href (str "#/page/" (get r :block/name) )} (get r :block/original-name) ] ) )

Unpleasant answer: You already know where to begin, but you have been avoiding it.

  • What you are currently doing:
    • Manage you life by keeping notes.
      • Notes can quickly get too many.
    • Manage your notes in Logseq by keeping them in journals.
      • Journal notes can quickly get too many.
    • Manage your journal notes by tagging them.
      • Tags can gradually get too many.
  • What you should additionally do:
    • Manage your tags by:
      • keeping notes about them
      • use meta-tags to tag them
        • Meta-tags eventually get too many.
      • Keep going with meta-meta-tags etc.
        • No need to bother with the exact meta-level of each tag, it will find its level(s) by itself.
  • Tag similar-meaning tags with the same meta-tag.
    • You already do that implicitly (and ineffectively), each time you put tags under namespaces.
  • Add notes to your tags to clarify their differences.
    • There is already a reason that you picked each tag in first place. Write that reason down.
  • Update any notes that have imprecise tags.
    • Yeah, this can get tiring, but it adds value to the notes.
  • Each time query with the appropriate tag or meta-tag.
    • The more precise the query, the less troubles processing the results.

Let’s do our best to simplify it, improve it, customize it, but this is the way.

Seems that you put a lot of effort into appearance, compatibility etc. Put half of it into properties and you won’t regret it.


What is this finding? Looks like some sort of ID… is this specific to your case?

I should really get into learning and understanding “queries” (datalog?) :see_no_evil: :unamused:

1 Like

Thank you for taking time to give such a good “Unpleasant answer” :joy:.

It’s a “Maybe” for me… have many pieces but can’t seem able to piece them together (for some reason :confused:)

How do you even do this (" Tag similar-meaning tags with the same meta-tag")?
I have started a long time ago a “Legend” Block (" keeping notes about them") for the Tags I intended to consistently use but have slipped since tags that are not in the Legend (although I am striving for that consistency and I add additional Tags to the Legend whenever I remember to)…

How are you meta-tagging tags? :no_mouth:

I started using properties once I managed to have Logseq Properties render OK in Markdown, so not too long ago and it seems to improve my notes mainly because I am adding a context:: property where I briefly explain the whereabouts of that note. Still, I have properties called Tags:: and tangentTags:: that shed more light on the matter but am not very sure it’s the right way to go so still experimenting.

Looks like I am overwhelmed by searching for the quality … :no_mouth:

Block references. As mentioned in my post. They shouldn’t show up in the results. But for me some do, so I just exclude them. I don’t know why they show though. But I’m not on my computer so I don’t have an easy way to find out. I simply excluded them just in case you run into the same.

What you quoted is the more advanced stuff of the advanced query. Sorting and look of the results.
If you want to get into queries, start with the simple ones and work your way up.

Can I just say that I always really enjoy reading your responses? They are always so insightful!

1 Like

Simply trying to add value to my own posts, before advising others to do so with their notes.

  • Open each tag’s page.
  • Write a note on what makes it different from the other.
  • Tag them with what they have in common.
    • The shared tag (preferably a property) is their meta-tag.
  • Open a tag’s page, then either:
    • Fill a property.
    • Tag a note:
      • Write the note.
      • Apply a tag to it.

Logseq makes it easy, but we have to do our own part.

No. The legend should not be a single block, should be the whole graph describing itself.


  • Those are better than nothing, but they are too generic.
  • Properties should be more to the point. Some ideas:
    • definition::
      • The body of the meaning.
      • What to read first.
    • essence::
      • The kernel of the meaning, usually:
        • a more abstract concept
        • a word from the definition
      • To group same-kernel tags.
    • quirk::
      • The skin of the meaning.
      • To differentiate similar-meaning tags.
    • relevance::
      • The purpose of the meaning.
      • Why you decided to make it a tag, instead of leaving it plain text.
    • etc.

If you start filling all this info for every tag, you may catch yourself spending more time with the tags than with the notes about your life.

  • This is up to you, you may fill as much as your time permits.
    • For every tag that you fill, you add value to all the notes tagged by it.
    • Therefore, give priority to tags that you apply more often.
  • One day we will be able to get most tags predefined from some libraries.
    • Until then, they are our work.

Oh ok, that makes perfect sense to add properties to Tags Pages. Also it makes perfect sense that for Tags Pages Properties one would have more pinpointed meta-tags. Couldn’t agree more. I was merely saying that I have started to use some Properties instead of Tags in my notes and for those I would use Context::, TangentTags::, etc.

Yeah, because those are the things that make it shine :slight_smile: and do what is really needed. Would it be possible to print one tag on a line and have them sorted by the number of times they are used in the graph? :see_no_evil: … now that would be useful to me because I would go the least used tags and see if they are variations of some more used tags and should be swapped for those.

Give this plugin a try:

1 Like

This looks useful, I’ll look into it. Thanks.

Yes. Count added between ( ).

{:title [:h3 "All pages"]
 :query [:find ?n ?name (count ?b)
  :keys n name count
   [?p :block/journal? false]
   [?p :page/name ?n]
   [?p :block/original-name ?name]
   (not [(contains? #{"TODO" "DOING" "DONE"} ?n)])
   [?b :block/refs ?p]
 :result-transform (fn [result] (sort-by (fn [r] (get r :count)) result))
 :view (fn [result] (for [r result] [:div [:a.tag.mr-1 {:href (str "#/page/" (get r :n) )} (str (get r :name) " (" (get r :count) ")") ] ] ) )
1 Like

This looks awesome. But how can I sort in descending order? :see_no_evil:

:joy: Here you go. Also small correction as it wasn’t filtering out the task pages. Oops!

{:title [:h3 "All pages"]
 :query [:find ?n ?name (count ?b)
  :keys n name count
   [?p :block/journal? false]
   [?p :page/name ?n]
   [?p :block/original-name ?name]
   (not [(contains? #{"TODO" "DOING" "DONE"} ?name)])
   [?b :block/refs ?p]
 :result-transform (fn [result] (sort-by (fn [r] (get r :count)) > result))
 :view (fn [result] (for [r result] [:div [:a.tag.mr-1 {:href (str "#/page/" (get r :n) )} (str (get r :name) " (" (get r :count) ")") ] ] ) )

Oh ok, the > angle bracket does the trick … < and no angle bracket do the same, namely ascending … also the Block References filter was missing :stuck_out_tongue_winking_eye: … but I managed to take those lines from the first one :crazy_face:

1 Like

I attempted to force the use of pages with :page/name instead, so that is why it is missing.