Last active
March 30, 2026 16:12
-
-
Save exdeejay/d342d9c18d1a28f1d56b0718028026a4 to your computer and use it in GitHub Desktop.
Obsidian Dataview snippet - List all tags sorted by frequency of use
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## Tags | |
| %% Copy the below text, including the ```, to use in your own file %% | |
| %% Make sure to turn on "Enable Javascript Queries" in Dataview's settings! %% | |
| ```dataviewjs | |
| // List all tags sorted by frequency of use | |
| let tags = dv.pages() | |
| .flatMap(page => page.file.tags) | |
| .groupBy(tag => tag) | |
| .sort(tag => tag.rows.length, 'desc') | |
| for (let tag of tags) { | |
| dv.span(tag.key + ' ') | |
| } | |
| ``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment