# Metadata key for 'Sort Title' in file?

**URL:** <https://forums.plex.tv/t/metadata-key-for-sort-title-in-file/778298>\
**Category:** Metadata & Adding Files\
**Tags:** library-management\
**Created:** [February 26, 2022, 2:09am UTC](https://forums.plex.tv/t/metadata-key-for-sort-title-in-file/778298 "2022-02-26T02:09:38Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Uuugggg](https://avatars.discourse-cdn.com/v4/letter/u/eb9ed0/32.png) [@Uuugggg](https://forums.plex.tv/u/Uuugggg)\
**Post date:** [February 26, 2022, 2:09am UTC](https://forums.plex.tv/t/metadata-key-for-sort-title-in-file/778298/1 "2022-02-26T02:09:38Z")

</div>

So I can ffmpeg -metadata title=“Title” and Plex will use “Title”. I want to set the sort title similarly. Is there a metadata key I can use for that? Is there a list of metadata to use?

I mean really I just want a way to automate and script this. Manually popping open a browser and clicking around a bunch for every file is tedious.

Server Version#:1.25.6.5577

---

<div class="post-metadata">

**Author:** ![OttoKerner](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/ottokerner/32/10079_2.png) [@OttoKerner](https://forums.plex.tv/u/OttoKerner)\
**Post date:** [February 26, 2022, 9:02am UTC](https://forums.plex.tv/t/metadata-key-for-sort-title-in-file/778298/2 "2022-02-26T09:02:13Z")

</div>

Start by telling which kind file. 😉

---

<div class="post-metadata">

**Author:** ![Uuugggg](https://avatars.discourse-cdn.com/v4/letter/u/eb9ed0/32.png) [@Uuugggg](https://forums.plex.tv/u/Uuugggg)\
**Post date:** [February 27, 2022, 6:55pm UTC](https://forums.plex.tv/t/metadata-key-for-sort-title-in-file/778298/3 "2022-02-27T18:55:59Z")

</div>

I mean, a video file? What, do you want mkv, mp4, avi? Worst case I can package in an mp4 if that’s what it takes. I mean, how many options do I even have to respond? Go ahead and answer with an answer if you have one. Better yet, a place where it lists metadata that Plex uses

---

<div class="post-metadata">

**Author:** ![OttoKerner](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/ottokerner/32/10079_2.png) [@OttoKerner](https://forums.plex.tv/u/OttoKerner)\
**Post date:** [February 27, 2022, 7:44pm UTC](https://forums.plex.tv/t/metadata-key-for-sort-title-in-file/778298/4 "2022-02-27T19:44:44Z")

</div>

Plex can only read the title tag from mp4/m4v files.  
AFAIK you can also use the year, description, and genre tags.  
If you set an “album” tag, Plex will automatically create a collection and place the file within.

---

<div class="post-metadata">

**Author:** ![Uuugggg](https://avatars.discourse-cdn.com/v4/letter/u/eb9ed0/32.png) [@Uuugggg](https://forums.plex.tv/u/Uuugggg)\
**Post date:** [February 27, 2022, 8:02pm UTC](https://forums.plex.tv/t/metadata-key-for-sort-title-in-file/778298/5 "2022-02-27T20:02:55Z")

</div>

So is that _only_ title/year/description/genre/album that it uses?

---

<div class="post-metadata">

**Author:** ![Uuugggg](https://avatars.discourse-cdn.com/v4/letter/u/eb9ed0/32.png) [@Uuugggg](https://forums.plex.tv/u/Uuugggg)\
**Post date:** [February 28, 2022, 1:06am UTC](https://forums.plex.tv/t/metadata-key-for-sort-title-in-file/778298/6 "2022-02-28T01:06:49Z")

</div>

I now used MetaX to write the metadata, which works with Plex - as metadata key “sort\_name” or apparently written as bytes ‘sonm’

The infuriating problem is that ffmpeg does not WRITE that metadata key for some godforsaken reason. It can READ that metadata and parse it as ‘sort\_name’ - but not WRITE it? It CAN write it to MKV files, but Plex doesn’t read MKV metadata at all? What gives there? ffmpeg can write all metadata under the MDTA format, which understandably I guess Plex can’t read.

I think my option now is to fork ffmpeg to actually write that metadata. Given that this sort\_name tag seems to be part of the MP4 spec and recognized by multiple tthings, ffmpeg ought to write it

---

<div class="post-metadata">

**Author:** ![Uuugggg](https://avatars.discourse-cdn.com/v4/letter/u/eb9ed0/32.png) [@Uuugggg](https://forums.plex.tv/u/Uuugggg)\
**Post date:** [March 2, 2022, 12:09am UTC](https://forums.plex.tv/t/metadata-key-for-sort-title-in-file/778298/7 "2022-03-02T00:09:52Z")

</div>

Also I’m now going to use exiftool to write the metadata -

```auto
exiftool.exe -SortName="Sorted Title" file.mp4

```

---

<div class="post-metadata">

**Author:** ![Uuugggg](https://avatars.discourse-cdn.com/v4/letter/u/eb9ed0/32.png) [@Uuugggg](https://forums.plex.tv/u/Uuugggg)\
**Post date:** [March 5, 2022, 7:06pm UTC](https://forums.plex.tv/t/metadata-key-for-sort-title-in-file/778298/8 "2022-03-05T19:06:50Z")

</div>

Actually my solution now is to use a plug-in 3rd party agent that reads a simple textfile sitting next to the movie (since Plex won’t read mkv metadata, and ffmpeg will delete mp4 metadata if you ever do additional processing to the file after adding SortName)

> **[GitHub - mistercam/TextFileMetadataAgent.bundle: A Plex agent to set metadata...](https://github.com/mistercam/TextFileMetadataAgent.bundle)**
>
> A Plex agent to set metadata from a text file. Contribute to mistercam/TextFileMetadataAgent.bundle development by creating an account on GitHub.

I did have to edit it to add title\_sort though but that was easy enough. And I can’t use Plex’s fancy new Plex Movie Agent for some reason because you can’t add plug-ins to it? Whatever, that doesn’t matter.

---

<div class="post-metadata">

**Author:** ![Uuugggg](https://avatars.discourse-cdn.com/v4/letter/u/eb9ed0/32.png) [@Uuugggg](https://forums.plex.tv/u/Uuugggg)\
**Post date:** [March 5, 2022, 7:08pm UTC](https://forums.plex.tv/t/metadata-key-for-sort-title-in-file/778298/9 "2022-03-05T19:08:57Z")

</div>

> [@OttoKerner](#):
>
> Start by telling which kind file.

gotta love the question, followed by “oh, I don’t have an answer for any file anyway”

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)\
**Post date:** [June 3, 2022, 7:09pm UTC](https://forums.plex.tv/t/metadata-key-for-sort-title-in-file/778298/10 "2022-06-03T19:09:17Z")

</div>

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