Skip to content

Expiring Notes is a plugin for Obsidian, enabling you to automatically delete or archive notes after a pre-set date.

Notifications You must be signed in to change notification settings

antonbrall/obsidian-expiring-notes

 
 

Repository files navigation

Expiring Notes

GitHub release (latest SemVer) GitHub All Releases


Important note: This plugin is forked and adds some more functionality. I will try to make it as stable as possible.


An Obsidian plugin to automatically delete or archive notes that have "expired". With this, you can give your notes a "best by" date and make them disappear as soon as they're obsolete, keeping your vault clean and uncluttered.

Example for those ephemeral notes include:

  • information that is only valid for a certain time
  • coupon and voucher codes with an expiry date
  • any information you just jotted down quickly that won't be important in a day or two
  • any ephemeral information you want to dump into your vault
  • if you're feeling lucky: set the expiry date on your novel draft to the end of November. Either it's done by then, or...

Installation

As this plugin is currently in early development, you can use BRAT to install it. Use the path joerncodes/obsidian-expiring-notes.

If you're interested in helping to make Expiring Notes a finished product, please see Contributing.

How to make a note expire

To mark a note to expire in the future, this plugin uses a predefined frontmatter key like so:

expires: 2021-01-01

In this example, this note will automatically be either archived or deleted after January 1st, 2021.

You can either write the frontmatter yourself or use the Set Expiry Date command.

Archive / Delete

Expiring Notes has two different modes of operation: delete and archive.

If a note gets deleted, it vanishes from your vault forever - there is no undo. Please use with appropriate caution.

If a note is archived, it gets moved to a predefined archive folder (you can customize the path in settings). Please note that if a file with the same name already exists in the archive, it will get overwritten.

Commands

Set Expiry Date

Use this command to set or modify the expiry date of the currently opened note. You can provide the date either in your chosen date format (see Settings), or using natural date parsing. Some examples include:

  • today
  • tomorrow
  • 1 week ago
  • 1 month from now
  • September 12
  • next year

Check for expired notes

Scan your vault for expired notes and then either delete or archive them, depending on the behavior you set in your Settings.

Settings

Frontmatter key
This is the key you use to provide an expiry date. The default is expires.
Date format
Used to specify the date format you want to write your expiry dates in. Visit momentjs.com for a list of possible date tokens.
Check for expired notes at startup
If this is enabled, Expiring Notes will collect all expired notes when you start Obsidian.
Check for expired notes regularly
If this is enabled, Expiring Notes will collect all expired notes every 5 minutes.
Enable confirm dialogue
If this is enabled, Expiring Notes will ask you if the expired notes it found should be archived/deleted now.
Behavior
Choose if your notes should be deleted (this has no undo) or moved to a predefined archive folder. Please note that files with the same name will overwrite older files in your archive folder.
Archive folder path
Provide the folder path for your archive (relative to your Obsidian vault root).
Day Offset
Set an amount of days to add to the expiry date. For example, if you set this to 1, the note will expire one day after the date specified in the frontmatter.

Changelog

You can find the changelog here.

Contributing

I'm hoping to make Expiring Notes as awesome as possible, and I need your help to do it. Any issue opened here on GitHub is appreciated, whether it be a bug or a feature request.

If you want to take the time to do a PR, those are welcomed with open arms.

About

Expiring Notes is a plugin for Obsidian, enabling you to automatically delete or archive notes after a pre-set date.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 95.9%
  • JavaScript 3.2%
  • CSS 0.9%