Search...Search plugins and themes...
⌘K
Sign in
  • Get started
  • Download
  • Pricing
  • Enterprise
  • Account
  • Obsidian
  • Overview
  • Sync
  • Publish
  • Canvas
  • Mobile
  • Web Clipper
  • CLI
  • Learn
  • Help
  • Developers
  • Changelog
  • About
  • Roadmap
  • Blog
  • Resources
  • System status
  • License overview
  • Terms of service
  • Privacy policy
  • Security
  • Community
  • Plugins
  • Themes
  • Discord
  • Forum / 中文论坛
  • Merch store
  • Brand guidelines
Follow us
DiscordTwitterBlueskyThreadsMastodonYouTubeGitHub
© 2026 Obsidian

Auto File Extension

sec-mlsec-ml17 downloads

Automatically change file extensions based on a trickle-down ruleset. Rules can match directory path, file content (using RegEx), or both.

Add to Obsidian
  • Overview
  • Scorecard
  • Updates2

Obsidian plugin that automatically changes file extensions based on a trickle-down ruleset. Rules can match by directory path, file content (regex), or both. First matching rule gets applied.

Warning

Obsidian isn't designed to use non .md files, and for the most part, won't see them. If you're using other MD-like filetypes, you'll need to also ensure that Obsidian can see them (unless you want to rename files and have them disappear from view. Maybe you do?). See: https://github.com/sec-ml/obsidian-anything-as-md

If you use Sync, you also need to make sure Obsidian is set to process unsupported files.

Lastly, file renaming won't work if a file already exists with the exact same filename. Sounds obvious, but if you're testing with a bunch of Untitled files with different extensions, it's something to be aware of.

How it works

Auto File Extension decides what to do from the file's extension and its content. Content rules always read the file from disk (vault.read()). For the current extension, it trusts Obsidian's file.extension by default — but if another plugin spoofs that (e.g. Anything as MD reports custom extensions as md), enable Get extension from file path so it reads the true extension from file.path instead. It never inspects the metadata cache, markdown classification, or UI badges.

Using with other plugins

Automatic run on file save is off by default to avoid race conditions with other file-processing plugins (Linter, Templater, etc.).

To trigger Auto File Extension manually, use the command palette: "Fix extension for current file" — runs on the active file. Command ID: auto-file-extension:fix-current-file

Auto File Extension does not try to coordinate ordering with other plugins. If you need a specific processing chain (e.g. Linter → Templater → Auto File Extension), configure the upstream plugin to run its command as its last step.

Install

  1. Copy main.js, manifest.json, and styles.css into your vault at .obsidian/plugins/auto-file-extension/.
  2. Enable Auto File Extension under Settings → Community plugins.

Development

npm install
npm run dev

Then run npm run test-copy to copy the built plugin into the test vault. Open the test-vault folder in Obsidian.

Scripts

  • npm run dev — watch build
  • npm run build — production build
  • npm run test-copy — copy plugin into test vault
  • npm run version — bump version (use with npm version)
  • npm run bump - testing this, do not use
  • npm run lint — eslint
93%
HealthExcellent
ReviewPassed
About
Rename file extensions automatically using a trickle-down ruleset that matches by directory path, file content (RegEx), or both. Apply the first matching rule and read file content from disk to decide the correct extension. Plugin can automatically run on file saves/modifications, or can be triggered manually with a command, allowing processing to be chained through multiple plugins. Note: By default, Obsidian can't see non-md files (another plugin will be needed to enable this, such as 'Anything as Markdown').
FilesAutomationCommands
Details
Current version
1.0.5
Last updated
4 days ago
Created
3 months ago
Updates
2 releases
Downloads
17
Compatible with
Obsidian 1.12.3+
Platforms
Desktop, Mobile
License
MIT
Report bugRequest featureReport plugin
Author
sec-mlsec-ml
GitHubsec-ml
  1. Community
  2. Plugins
  3. Files
  4. Auto File Extension

Related plugins

QuickAdd

Quickly add new notes or content to your vault.

Advanced URI

Control everything with URI.

Actions URI

Add additional `x-callback-url` endpoints to the app for common actions — it's a clean, super-charged addition to Obsidian URI.

Persistent Graph

Save and restore the positions of nodes on your graph.

Task Collector

Change task status and collect tasks within a document using hotkeys and context menus.

Attachment Management

Customize attachment path, auto-rename attachments, etc.

Vault Changelog

Maintain a changelog of recently edited notes.

Shell commands

Define system commands that you want to execute via command palette, hotkeys, URI links or automated events. E.g. open external applications or perform automated file modifications.

Notebook Navigator

A better file browser and calendar inspired by Apple Notes, Bear, Evernote and Day One.

Templater

Create and use dynamic templates.