How can I find tags that are only used once?

My task is this:

  • I’d like to remove unique tags - those appearing only once - from those tiddlers with more than one tag.
  • the problem arises from the too-frequent (daily) tagging of Journal tiddlers

The discussion here suggests the tools to tackle this, but my filter skills are limited. I noticed the discussion identifying non-unique tiddlers.

I think my first lesson will be “what are you doing with Spaces in a Tag name”?

Which suggests a use of, is it, the Tag Commander to, say, replace spaces with an underline? Or nothing at all?

Try this: [tags[]] :filter[<currentTiddler>tagging[]count[]match[1]] in your Advanced Search → Filter tab.

See the docs about used operators.

I personally would only remove them, if they really do make no sense and you have an excessive amount of them. If you think it may make sense in the future, keep it for eg: 1 month and revisit them again.

1 Like

I like the Tag Manager ($:/TagManager) for this. It lets you see all the tags, along with counts per-use. This can let you find underused tags to prune them.

1 Like

Thanks. The list is long. It seems one reason I need to trim these solo tags, is that many searches take some ( like ~10 ) seconds.

Thanks. With the operators’ guidance, the rest should be easy. For example, now, just where is that tag? Resist the temptation to write the one-liner to return the tag’s tiddler.

1 Like

Sorry, I forgot, that the list shows the tags and not the tiddlers. The following table lists the tiddlers, the tags and and a delete tag button. There is no “delete this tag” warning. So

Backup – Backup – Backup !

The following code can be tested at tiddlywiki.com

\procedure removeTagAction()
<$action-listops $tiddler={{{ [<oneTag>tagging[]] }}} $tags="-[<oneTag>]"/>
\end

\procedure removeTagButton()
<p><$button actions=<<removeTagAction>> >
{{$:/core/images/delete-button}}
</$button></p>
\end

<table><tbody>
<$list filter="[tags[]] :filter[<currentTiddler>tagging[]count[]match[1]]" variable="oneTag">
  <tr>
    <td>{{{ [<oneTag>tagging[]] }}}</td><td>  is tagged: ''<<oneTag>>''</td><td><<removeTagButton>></td>
  </tr>
  </$list>
</tbody></table>

Also see: Used widgets docs

have fun!
Mario

For most wikis tags with spaces are fine. I personally do not like the underline, because it is hard to type. I prefer a hyphen eg: my-tag.

What does long mean for you. 1000, 2000 which should actually not be a problem for tags. They are highly optimized and cached internally.

So how many tiddlers do you have? This can be seen in the $:/ControlPanel → Basics tiddler.

If a filter needs 10 seconds for you, there probably is a slow filter somewhere. What exactly takes 10 seconds?