How to update markdown image paths after a rename
- Step 1Note the old and new names — Identify the exact rename, e.g.
assets/→media/, orimg/2024/→img/archive/2024/. - Step 2Load the document — Paste the Markdown or upload a single
.md/.mdx/.markdown/.txtfile that references the renamed directory. - Step 3Enter the old fragment — Type the old folder path into Find. Include a trailing slash (e.g.
assets/) to avoid matching similarly-named files. - Step 4Enter the new fragment — Type the new folder path into Replace (e.g.
media/). - Step 5Use regex for complex renames — Tick Treat Find as regex if the rename inserts or reorders segments, and reference the kept part with
$1. - Step 6Run and download — Click Run Image Paths, confirm only the renamed paths changed, then Copy or Download the updated Markdown.
Rename scenarios and settings
Pick literal or regex depending on whether the rename is a clean substring swap.
| Rename | Find | Replace | Regex |
|---|---|---|---|
| assets/ → media/ | assets/ | media/ | off |
| img/ → static/images/ | img/ | static/images/ | off |
| Insert a year archive segment | ^img/(\d{4})/(.+)$ | img/archive/$1/$2 | on |
| Rename a single file | hero-old.png | hero-new.png | off |
Literal vs regex for renames
The most common rename is literal; reach for regex only when a substring swap can't express it.
| Mode | Scope | Best for |
|---|---|---|
| Literal (regex off) | Replaces every occurrence of Find | Folder rename, file rename, exact-string swaps |
| Regex (regex on) | Replaces the first match per path; $1 capture | Inserted segments, reordering, variable prefixes |
| Empty Find | Prepends Replace to every relative path | Not a rename — use for adding a base/prefix instead |
Plan limits (markdown family)
Size and character ceilings per tier.
| Plan | Max file size | Max characters | Files per run |
|---|---|---|---|
| Free | 1 MB | 500,000 | 1 |
| Pro | 10 MB | 5,000,000 | 10 |
| Pro-media | 50 MB | 20,000,000 | 50 |
| Developer | 500 MB | unlimited | unlimited |
Cookbook
Directory-rename recipes. Include a trailing slash in Find to keep the swap scoped to the folder.
Folder rename assets/ → media/
A literal swap with a trailing slash updates every image under the renamed folder.
Find: assets/ Replace: media/ Regex: off Before:  After:  Reference definition updated too: Before: [d1]: assets/diagram.png After: [d1]: media/diagram.png
Nest images under a new parent
Move img/ under static/ by swapping the leading fragment.
Find: img/ Replace: static/images/ Regex: off Before:  After: 
Insert an archive segment with regex
Keep the year and filename, insert an archive/ segment between them.
Find: ^img/(\d{4})/(.+)$
Replace: img/archive/$1/$2
Regex: on
Before: 
After: Rename a single image file
Swap one filename precisely with a literal Find — no folder slash needed here.
Find: hero-old.png Replace: hero-new.png Regex: off Before:  After: 
External images stay put
A folder rename only affects local paths; absolute URLs that happen to contain the fragment are skipped.
Find: assets/ Replace: media/ Regex: off Before:  After:  (skipped — absolute)
Edge cases and what actually happens
Trailing slash omitted in Find
CautionFind assets (no slash) also matches assets-old/ or a file named assets.png. Include the trailing slash (assets/) to scope the rename to the folder.
Absolute URL contains the old folder name
PreservedEven if https://cdn.io/assets/x.png contains assets/, it's skipped because the path is absolute. The rename applies only to relative references.
Single-file rename, not a folder
Use exact filenameFor renaming one image, put the old filename in Find and the new one in Replace. Prefix mode (empty Find) does not help with renames.
Regex replaces only the first match
By designRegex mode lacks a global flag and replaces the first match per path. If a folder name repeats within a single path, literal mode (replace-all) is the right choice.
New name is a superset of the old
CautionRenaming img/ to img/archive/ with literal mode is fine for a single occurrence, but if a path already contains img/archive/, re-running would nest again. Run once from the pre-rename source.
Invalid regex pattern
ErrorAn unbalanced group or bad quantifier throws at compile time and the run fails. Escape dots as \. and double backslashes in the Find box.
Path with spaces
Not matchedAn un-encoded space breaks the inline match, so that image isn't updated. URL-encode spaces (%20) before the rename pass.
Document exceeds the size limit
RejectedFree caps at 1 MB / 500,000 characters. Split or upgrade for very large documents.
Many documents reference the renamed folder
Single per runUpdate one file per run. Merge with the merger and re-split, or run each file separately.
Frequently asked questions
How do I update every image after renaming a folder?
Put the old folder fragment in Find (e.g. assets/) and the new one in Replace (e.g. media/). Literal mode swaps every occurrence in one pass — inline images and reference definitions alike.
Why include a trailing slash in Find?
Without it, assets could match assets-old/ or a file called assets.png. The trailing slash (assets/) scopes the swap to the folder so unrelated names aren't touched.
Can I rename a single image file instead of a folder?
Yes. Put the old filename in Find and the new one in Replace. There's no need for prefix mode — that only adds a base, it doesn't rename.
What if the rename inserts a new path segment?
Use regex. Tick Treat Find as regex, capture the parts to keep with groups, and rebuild the path in Replace with $1, $2. Example: Find ^img/(\d{4})/(.+)$ → Replace img/archive/$1/$2.
Are reference-style image definitions updated?
Yes — the [id]: path definition line holds the path and is rewritten along with inline images, so reference-style images follow the rename.
Will it change external images that contain the old folder name?
No. Absolute http(s)://, //, and data: references are skipped, even if they contain the renamed fragment. Only relative paths are updated.
Does literal mode replace all occurrences or just one?
All of them. Literal mode uses a split/join, so every occurrence of Find in every relative image path is replaced. Regex mode, by contrast, replaces only the first match per path.
What happens if my regex is invalid?
The run fails with an error because the pattern can't compile. Escape literal dots as \. and remember backslashes must be doubled when typed into the Find box.
Could re-running double-apply the rename?
If the new name contains the old fragment (e.g. img/ → img/archive/), a second run could nest again. Run once from the original, pre-rename document to avoid this.
How big a file can I update?
Free 1 MB / 500,000 characters; Pro 10 MB / 5,000,000; Pro-media 50 MB / 20,000,000; Developer 500 MB / unlimited.
Can I update many files at once?
It's one file per run. Combine documents with the merger, run the rename, then split again with the splitter.
How do I confirm nothing slipped through?
Run the updated file through the link validator to confirm every image reference resolves to the renamed location.
Privacy first
All Markdown processing runs locally in your browser using JavaScript. No file is ever uploaded to JAD Apps servers — only metadata counters are saved for signed-in dashboard stats.