# Plex sorting artist by LASTNAME

**URL:** <https://forums.plex.tv/t/plex-sorting-artist-by-lastname/528102>\
**Category:** General Discussions\
**Tags:** server-windows\
**Created:** [January 16, 2020, 10:13pm UTC](https://forums.plex.tv/t/plex-sorting-artist-by-lastname/528102 "2020-01-16T22:13:23Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![leelynds](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/leelynds/32/82049_2.png) [@leelynds](https://forums.plex.tv/u/leelynds)\
**Post date:** [January 16, 2020, 11:32pm UTC](https://forums.plex.tv/t/plex-sorting-artist-by-lastname/528102/10 "2020-01-16T23:32:04Z")

</div>

I was lucky enough to spot the sorting order issue cause by Picard soon enough, it was easy to fix.

You can set some options in Picard in the “Scripting” section. I created 2 scripts, the first one:

```auto
$set(artistsort,%artist%)
$set(albumartistsort,%albumartist%)

```

which sets the sorting order to the Album Artist, which is usually FirstName\_LastName.

That worked well, until I realized that it would set the sorting in Plex to “The Beatles” instead of just “Beatles”.

So I disabled that script, and created a new one, that removes the sort tags downloaded from MusicBrainz before they are written to the file. Seems to work properly (for now 🤔 )

```auto
$delete(artistsort)
$delete(albumartistsort)

```

Try them and see which one works best for you.

---

_[View the full topic](https://forums.plex.tv/t/plex-sorting-artist-by-lastname/528102)._
