Have you ever wanted to remove something from the recently added list in Plex? Or change the order? Here is how.
Plex uses a modified version of SQLite to store its data. So first you need to find where the Plex SQLite binary is located, you should not use the normal SQLite package. This Plex support article lists where the binary is stored in each system.
For some reason it doesn’t list FreeBSD which is what I run since I run Plex in a jail on TrueNAS core. On that system it’s located here.
/usr/local/share/plexmediaserver-plexpass/Plex\ SQLite
Which means that the command to edit the database would be the following.
/usr/local/share/plexmediaserver-plexpass/Plex\ SQLite /usr/local/plexdata-plexpass/Plex\ Media\ Server/Plug-in\ Support/Databases/com.plexapp.plugins.library.db
Don’t forget to stop Plex and take a backup of the database before you start editing it.
service plexmediaserver_plexpass stop cp /usr/local/plexdata-plexpass/Plex\ Media\ Server/Plug-in\ Support/Databases/com.plexapp.plugins.library.db /root/
Now you are ready to run the SQLite command above to start editing. Once you run it you will get into the SQLite prompt, run the following.
sqlite> .mode line sqlite>
This will change the output format so that you can actually read the data from the coming select queries that we will do.
Before we change any data we need to make sure we are selecting the data that we actually want to edit. Run the following and replace where it says BLA with the title of the item you want to edit, for instance “Die Another Day” if that is the movie you want to edit.
SELECT * FROM metadata_items WHERE lower(title) LIKE lower('%BLA%');
Make sure it only returns the item that you want to edit, usually that will be just one item. The field we want to update is the one called added_at. The number there is the epoch time of when the item was added to the library. In order to remove it from the recently added list we simply change the time to sometime in the past, for instance one year in the past. To get the number to change to you can visit an online epoch time converter.
When you have the number you can create the query that will be used to update the database.
UPDATE metadata_items SET added_at = 'THE EPOCH TIME YOU WANT' WHERE lower(title) LIKE lower('%BLA%');
You can now run the same select query again and you should see that the created_at time has been updated. You can now exit out of the SQLite interface and start up Plex again.