Remove Play History

Server Version#: 1.27.0.5897
Player Version#:1.46.1.3056-ab91bdc0

Is there any way to clear/purge play history? I have several shows/movies with iplay history from 2019 where the movie/episode is marked as played several times with the same timestamp. Even better is there a way to clear/purge play history for individual movies/shows? I do NOT want to clear the watched/unwatched status.

Regards,

James

You can do that in Plex Dash.
e.g. search the movie/episode, show its watch history and remove the unwanted entries (swiping the entry to the left will show the Delete option).

That’s awesome, thanks!

Now, another question!

Is there a way to remove deleted users from the play history?

Regards,

James

I’m not aware of any way except to mess with the database itself.

@JTSONLINE

This is not supported but easily done.

If you corrupt the DB due to an error, it will be up to you to recover from one of the backups in the Databases directory.

To purge all watch history, you will need sqlite3 / Plex\ SQLite

You want to remove all rows from table metadata_item_settings.

Thanks very much! My plex is running on Ubuntu 22.04 so I used:

/usr/lib/plexmediaserver/Plex\ SQLite

sqlite> .open ‘/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db’
sqlite> select id, name from accounts;

THEN

sqlite > DELETE FROM media_item_settings WHERE account_id = x;
sqlite > DELETE FROM media_part_settings WHERE account_id = x;
sqlite > DELETE FROM media_stream_settings WHERE account_id = x;
sqlite > DELETE FROM metadata_item_accounts WHERE account_id = x;
sqlite > DELETE FROM metadata_item_settings WHERE account_id = x;
sqlite > DELETE FROM metadata_item_views WHERE account_id = x;
sqlite > DELETE FROM play_queues WHERE account_id = x;
sqlite > DELETE FROM plugin_permissions WHERE account_id = x;
sqlite > DELETE FROM statistics_bandwidth WHERE account_id = x;
sqlite > DELETE FROM statistics_media WHERE account_id = x;
sqlite > DELETE FROM view_settings WHERE account_id = x;

Worked great. All play history for the deleted accounts has been removed. Plex still running :slight_smile:

Now, I’m wondering if I can remove those deleted accounts from the accounts table …

I am not that knowledgeable with the DB.

I’m the OS guy who knows ‘just enough to get himself in trouble’.

If you want to stop plex, make a copy, make the changes, and try – there won’t be any harm if you have to roll back.

Well, seems to have worked …

sudo service plexmediaserver stop
sudo bash
/usr/lib/plexmediaserver/Plex\ SQLite
sqlite>.open ‘/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db’
sqlite> select id, name from accounts;
sqlite> DELETE FROM accounts WHERE id = x;
sqlite> .exit
sudo service plexmediaserver start

Accounts I deleted are gone from the “All Users” drop down in the dashboard & play history.

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