Add actors to a movie in the plex database (how to add missing actors)

Server Version#:
Player Version#:

While it is true that their is no way to add actors manually through the plex interface, it is possible to add them to the database. I have done this several times, but would advise extreme caution as you can and will cause massive issue if you don’t do this correctly. Also note that this only works for existing actors, meaning actors that are in a movie already found on plex.

Once again this is only for those who have db experience. I am not going to explain where the database is or how to open it (you should know this info if you are knowledgeable enough to do this)

using the movie "True Women (1997)) - the reason i pick this movie is that plex will not add it to movies as the tmdb considers it a mini series, i however consider it a tv movie. So i have had to modify the database to add actors/actresses (most the other things, i could add through the plex interface - not sure why plex will not let you add actors/actresses to movies through the web interface as there are many movies with out complete cast??? (- just dumb but that is how it is)

in the plex db their are two tables we are interested in: tags and taggings

First step, you (this step in done in the plex interface web, app etc) need to find the exact name of the actor or actress in question you can do this by searching in the search bar. this will give you the name (exact name) of the actor/actress. in my example i am using “Angelina Jolie”

Second step (also in the plex app), is to find the movie you wish to add the actor or actress to. Once you have the movie you need to click on the three dots and click on get info, etc at the bottom click on “View XML”, this will open another tab and in this xml file you will find a unique id that plex uses for the movie in question. look for one of the following tags ( they both contain the same needed info) Video ratingKey=“286578” or key="/library/metadata/286578" we need the number in this case 286578
we now have the following info
Angelina Jolie - actor/actress
286578 - unique id of movie we are adding actor/actress to (this is unique to each plex server db)

Third step is to open the db for reading (we do not need to write to the db yet). open the tag table and in the tag field search for the actor or actress in question. in my example i searched for “Angelina Jolie” and found three entries (this next part is important to get right) In my database she has three entries one each for being and actress, director and producer. The tag type for actress or actor is “6” at least in my database and “4” is for directors?? (YOU NEED TO MAKE SURE THE TAGS ARE 4 AND 6 FOR YOU DATABASE AS WELL, i don’t know if this is always the case or each database is different.) I did several queries in the tagging table (note this is a different table than the one we are using) with different movies to make sure this was correct . Once we have the correct entry (back to the tag table)we will need to grab the id tag (in my case 4779, it will be different in yours) now we have all the info we need.

info we have collected:

Angelina Jolie - actor/actress
286578 - unique id of movie we are adding actor/actress to (this is unique to each plex server db)
4779 - unique idenifier of Angelina Jolie as a actress not a director, producer etc.)

thing you should already have or get from imdb:

Georgia Virginia Lawshe Woods - the name of character played by Angelina Jolie in this particular movie

0 - the position of importance (in this case imdb has it as first billing) so this is 0 (zero) second is 1 and so on

now we will need to open the tagging table to write our info to the database.
field - data
metadata_item - 286578 -
tag_id - 4779 -
index - 0
text - Georgia Virginia Lawshe Woods

step 1) open the tagging table to write
step 2 ) add a new record
step 3) add the previous discovered info the following fields metadata_item tag_id index text

id metadata_item tag_id index text time_offset end_time_offset thumb_url created_at extra_data
self generating 286578 4779 0 Georgia Virginia Lawshe Woods NULL NULL NULL 2020-04-03 00:24:52 NULL
3 Likes

Thanks heaps @plex-linux this works a treat. For step three, I find it easier to open another movie which has the actor tag correctly identified and you can obtain the tag_id from the “View XML” option. The string from there:

eg; <Role id=“47975” filter=“actor=47975” tag=“Angelina Jolie”

For anyone else wanting to do the same, I recommend using sqlitebrowser.org as a nice light client for opening and editing the com.plexapp.plugins.library.db database.

You can also add your own actor/actresses by going to the ‘tags’ table and inserting a new record.

The actor id will be the ‘id’ number (automatically generated), add the name under ‘tag’, make the ‘tag_type’ 6 and ‘user_thumb_url’ a URL to an image of your actor/actress.

You can then add this actor/actress to the movie as per the above instructions.

1 Like

Is this procedure only working with movies? I can’t see the “Get Info” and “View XML” options for tv series… am I doing something wrong?

Thank you.

It appears I’ve claimed success too quickly. Randomly, when I select a movie to watch Plex refreshes the metadata and the actor disappears with the refresh. @plex-linux have you encountered this?

it’s a great start provided by @plex-linux. I did find some other things useful. as @Valharion suggested, download sqlitebrowser. open the database and under the “browse data” tab, you can go through the tables.

Get movie id:

Get tag id:

  • View tags table
  • Actors have a tag_type of 6
  • Search for the actor you want in the tag field
  • Get the id of the field
    plex 2

Add to taggings:

  • Open taggings table
  • Type the movie id in the metadata_item_id
  • Click the New Record button
  • Type in the tag_id
  • Index field is a sequence, enter the next number
  • Text is the character name
  • Created_at field is a timestamp that can be copied/pasted from another record

Ok, looks like I’ve solved the ‘refresh problem’ also. Whilst in the ‘metadata_items’ table you can scroll to the right to the ‘user_fields’ column where plex specifies the locked fields.

Simply add |19 to the end of the locked fields to lock the actor/actress you’ve added manually.

This will prevent the actor/actress item you’ve added from being removed when the movie/tv show metadata is refreshed.

1 Like

thanks for adding the lock part, i forgot about that and got bit by a refresh!!!

Yeah, it ‘bit’ me quite a few times until I figured it out. Plex seems to do a type of refresh on individual items every now and then (even with it turned off in settings). Since I started locking it my manually added actors have remained in place ever since so this process works really well.

I have used the setting before when modifying other things in the database ( i have s script that i have used in the past to add collection tags and i used it for that) but it completely escaped my attention on this one and sure enough i had to redo the actor modifications i made.

very good addition and a good reminder!

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