# Best practise to rewrite filenames from titles incl. special chars?

**URL:** https://community.mp3tag.de/t/best-practise-to-rewrite-filenames-from-titles-incl-special-chars/69171
**Category:** Mac
**Created:** [July 21, 2025, 3:16pm UTC](https://community.mp3tag.de/t/best-practise-to-rewrite-filenames-from-titles-incl-special-chars/69171 "2025-07-21T15:16:48Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Willy1965](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/w/ba9def/32.png) [@Willy1965](https://community.mp3tag.de/u/Willy1965)
#### Post date: [July 21, 2025, 3:16pm UTC](https://community.mp3tag.de/t/best-practise-to-rewrite-filenames-from-titles-incl-special-chars/69171/1 "2025-07-21T15:16:48Z")

</div>

Hi all, more of a question how are users are handling the following. I recently started tagging some CD Albums whereas some titles have special characters such as ":" or "/" as part of the title, e.g. "My Title Part II: This / That" (see screenshot for reference).

By default (?) mp3tag replaces all these with an "\_" underscore. My question would be: is there any kind of best practise for this in order to keep the filenames intact when I change the files names based on my titles?

Is there anything that others recommend? I am new to mp3tag and not sure if there is a regex pattern that is recommended in this specific case. Would love to hear how other users replace these chars for their filenames...

 ![SCR-20250720-npxi](https://community.mp3tag.de/uploads/default/original/3X/6/8/6867f516663ba67ade86da38cf27e370fca8e070.png)

---

<div class="post-metadata">

### Author: ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)
#### Post date: [July 21, 2025, 3:18pm UTC](https://community.mp3tag.de/t/best-practise-to-rewrite-filenames-from-titles-incl-special-chars/69171/2 "2025-07-21T15:18:58Z")

</div>

Do you ask this on Mac?  
If yes, please use the support-category #Mac

I ask this because macOS does not have the same restrictions on file names as NTFS does for Windows.

---

<div class="post-metadata">

### Author: ![MotleyG](https://community.mp3tag.de/user_avatar/community.mp3tag.de/motleyg/32/440_2.png) [@MotleyG](https://community.mp3tag.de/u/MotleyG)
#### Post date: [July 21, 2025, 4:48pm UTC](https://community.mp3tag.de/t/best-practise-to-rewrite-filenames-from-titles-incl-special-chars/69171/3 "2025-07-21T16:48:56Z")

</div>

> [@Willy1965](#):
>
> By default (?) mp3tag replaces all these with an "\_" underscore. My question would be: is there any kind of best practise for this in order to keep the filenames intact when I change the files names based on my titles?

The actual TITLE tag remains intact without change. Only the filename is changed by mp3tag based on removing exceptional characters that are not permitted by the OS. Using the $validate function can ensure this is followed and even allows the user to define what the replacement character will be.

> **[Scripting Functions – Mp3tag Documentation](https://docs.mp3tag.de/scripting/#string-functions:~:text=in%20upper%20case.-,%24validate(x%2Cy),-returns%20the%20given)**
>
> Documentation on Mp3tag's scripting functions. Mp3tag is the universal Tag Editor.

---

<div class="post-metadata">

### Author: ![Florian](https://community.mp3tag.de/user_avatar/community.mp3tag.de/florian/32/5759_2.png) [@Florian](https://community.mp3tag.de/u/Florian)
#### Post date: [July 22, 2025, 4:05pm UTC](https://community.mp3tag.de/t/best-practise-to-rewrite-filenames-from-titles-incl-special-chars/69171/4 "2025-07-22T16:05:29Z")

</div>

I've moved this to the #Mac category, and on macOS the `$validate()` scripting function is not available.

In your case, Mp3tag automatically replaces characters that can't be used in filenames on macOS (while preserving the contents of the title field, as already pointed out by @MotleyG).

If you want to use a different replacement character, you can use the `$replace()` scripting function, e.g., `$replace(%title%,:,-,/,-)` to replace the special chars by dashes.

* * *

There is also the configuration setting **Replace invalid NTFS characters** at _[Preferences → General → Filenames](https://community.mp3tag.de/t/preferences-and-configuration/56296#filenames-5)_ which is most likely already enabled in your configuration.

> If enabled, characters that are not allowed in Windows NTFS filenames are automatically replaced by an underscore `_` on field lookup. The following characters are replaced: `\ : / * ? < > | "`.

> Enabling the automatic replacement also prevents folder creation when using the converter **Tag - Filename** with fields that contain the forward slash character `/`.

---

<div class="post-metadata">

### Author: ![system](https://community.mp3tag.de/uploads/default/original/2X/c/ce7035d426cb755a7916793326d23b465222a407.png) [@system](https://community.mp3tag.de/u/system)
#### Post date: [August 21, 2025, 4:06pm UTC](https://community.mp3tag.de/t/best-practise-to-rewrite-filenames-from-titles-incl-special-chars/69171/5 "2025-08-21T16:06:24Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
