Deleting all tiddlers with specific tag

426 views
Skip to first unread message

Ulrik Stervbo

unread,
Apr 16, 2014, 8:55:19 AM4/16/14
to tiddl...@googlegroups.com
Hello list,

I fear I have played to much and my TW is just a plain mess. There are some tiddlers I'd like to keep and I have some templates I would like to avoid having to redo, but most of it need to go.

Is there a way of deleting all tiddlers with given tags? Is there a clever use of regular expression on the html file that can help me with this? A way of exporting the TW with just tiddlers starting with $:/?

Cheers,
Ulrik

Danielo Rodríguez

unread,
Apr 16, 2014, 9:09:05 AM4/16/14
to tiddl...@googlegroups.com
Hello Ulrik

I have plans to develop a plugin for managing this kind of task. Export / import plugins and deleting.

Meanwhile, if this is very urgent you can do it with the console of chrome. I will give you the exact commands when I come back home. Regard

Danielo Rodríguez

unread,
Apr 23, 2014, 1:17:47 PM4/23/14
to tiddl...@googlegroups.com
Hello Ulrik,

Sorry I almost forgot about this.

Here is how can you do it.

Firs of all I recommend you to create a tiddler and put the tag filter that you are going to use inside triple brazets. Something like this

{{{  [tag[tag1]tag[tag2]]  }}}

That will display a list of tiddlers that has te tag1 AND tag2. If you want tiddlers with any of those tags, just use

[tag[tag1]] [tag[tag2]]

after that, open a console and put the following sentences. Replace the example filter with your own filter 

var tiddlersToDelete=$tw.wiki.filterTiddlers("[tag[tag1]tag[tag2]]")

You can copy paste the following sentence.

for(var i in tiddlersToDelete) $tw.wiki.deleteTiddler(tiddlersToDelete[i])

After the previous sentence the tiddler you created at first step will go empty. Then save your wiki and you're done. I recommend to sabe a backup.

Let me know if you have any problem or if you finally got it.
Regards.

Ulrik Stervbo

unread,
Apr 24, 2014, 1:33:13 AM4/24/14
to tiddl...@googlegroups.com
Thanks! It worked without any problems.

Cheers,
Ulriki


--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/YYGyuvMxAgU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages