Auto-removing "The" in artist sort fields?

I have seen a couple of discussions but haven’t quite seen what I’m looking for…

I would love to have a script that automatically removes "The " from artist names, but only on the sort fields - not the Artist fields. I don’t even really about reformatting to, say “Beatles, The” since the “Beatles” part is the only part I care about.

I’ve found as I go through cleaning up my library, there are some bands that will use both from album to album - for example, “The Pretenders” and just “Pretenders”. I don’t mind keeping the names as used, but would love to sort them consistently.


There’s a few ways to trim this tree, but if CONSISTENCY is the goal, a script using the Additional Artists Variables plugin might be what you are looking for.

Specifically, “_artists_album_primary_std” I believe is the variable you want. This will pull the top-level, “standard” artist, replacing any instances where the artist is “credited as” which is usually what creates discrepancies when tagging.

In practice, that might look something like the following:


Alternatively, if articles are what is bothering you, the “albumartistsort” variable might be of use. The caveat being that the data has to be correct in MusicBrainz. It’s a nice flag to know that an artist’s Sort Name needs cleanup, but I can also see it leading to continued annoyance if you don’t catch it before saving.


Now if you are saying that the albumartistsort field is returning artists with articles like “the” at the beginning, that tells me the sort name, as mentioned above, is incorrect in the database. You could either correct it in MB and reload the album in Picard, OR create a script that removes the articles altogether. The caveat being that most scripts I can think of off the top of my head that don’t devolve into RegEx mania will remove ALL instances of “the”.