[TW5] Can I bulk delete a tag?

115 views
Skip to first unread message

Jeff Vance

unread,
Apr 29, 2017, 10:38:15 AM4/29/17
to TiddlyWiki
Not sure if this is possible:  I have about 100 tiddlers that have a certain tag.  I decided I don't want that tag to exist anymore, but keep all those tiddlers since they are also tagged by other things.  Is there a way to remove the tag from every tiddler in one operation?  I don't want to manually edit all of them!


RichardWilliamSmith

unread,
Apr 29, 2017, 11:55:49 AM4/29/17
to TiddlyWiki
You can do something like this. 

!!!This removes a tag from every tiddler that has it
Be careful. There is no undo.
<table>
<tr>
<td>
remove
</td>
<td>
<$select tiddler=<<currentTiddler>> field="tagtoremove" default='notset'>
<$list filter='[all[tiddlers]tags[]sort[]]'>
<option value=<<currentTiddler>> field="tagtoremove"><$view field='title'/></option>
</$list>
</$select>
</td>
<td>

<$set name="oldTag" value={{!!tagtoremove}}>
<$button>
<$list filter="[all[shadows+tiddlers]tag{!!tagtoremove}]">
<$fieldmangler>
<$action-sendmessage $message="tm-remove-tag" $param=<<oldTag>>/>
</$fieldmangler>
</$list>
Click me!
</$button>
</$set>

</td>
</tr>
<tr>
<td>
</td>
<td>
<$list filter="[all[shadows+tiddlers]tag{!!tagtoremove}]">
<$link>{{!!title}}</$link>
</$list>
</td>
<td>
</td>
</tr>
</table>

I just re-purposed this from a similar widget I have that swaps one tag for another. I tested this version just now and it seems to work but please back-up your wiki before you use it.

Regards,
Richard

Jeff Vance

unread,
Apr 30, 2017, 11:59:19 AM4/30/17
to TiddlyWiki

Thank you!  I just tried this and it worked perfectly.  I also appreciate the warning on backing up, although I'm extra careful about that stuff so no need to worry.  (I actually create 2 backups to different locations on a regular basis).

Cheers,

Jeff


Reply all
Reply to author
Forward
0 new messages