# Remove Play History

**URL:** <https://forums.plex.tv/t/remove-play-history/797332>\
**Category:** Plex Media Server\
**Tags:** server-linux\
**Created:** [June 16, 2022, 4:53pm UTC](https://forums.plex.tv/t/remove-play-history/797332 "2022-06-16T16:53:39Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![JTSONLINE](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/jtsonline/32/279466_2.png) [@JTSONLINE](https://forums.plex.tv/u/JTSONLINE)\
**Post date:** [June 16, 2022, 4:53pm UTC](https://forums.plex.tv/t/remove-play-history/797332/1 "2022-06-16T16:53:39Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![tom80H](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/tom80h/32/19753_2.png) [@tom80H](https://forums.plex.tv/u/tom80H)\
**Post date:** [June 16, 2022, 5:00pm UTC](https://forums.plex.tv/t/remove-play-history/797332/2 "2022-06-16T17:00:32Z")

</div>

> [@JTSONLINE](#):
>
> Even better is there a way to clear/purge play history for individual movies/shows?

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).

---

<div class="post-metadata">

**Author:** ![JTSONLINE](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/jtsonline/32/279466_2.png) [@JTSONLINE](https://forums.plex.tv/u/JTSONLINE)\
**Post date:** [June 16, 2022, 7:13pm UTC](https://forums.plex.tv/t/remove-play-history/797332/3 "2022-06-16T19:13:46Z")

</div>

That’s awesome, thanks!

Now, another question!

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

Regards,

James

---

<div class="post-metadata">

**Author:** ![tom80H](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/tom80h/32/19753_2.png) [@tom80H](https://forums.plex.tv/u/tom80H)\
**Post date:** [June 16, 2022, 7:51pm UTC](https://forums.plex.tv/t/remove-play-history/797332/4 "2022-06-16T19:51:21Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ChuckPa](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/chuckpa/32/79710_2.png) [@ChuckPa](https://forums.plex.tv/u/ChuckPa)\
**Post date:** [June 16, 2022, 8:20pm UTC](https://forums.plex.tv/t/remove-play-history/797332/5 "2022-06-16T20:20:45Z")

</div>

@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`.

---

<div class="post-metadata">

**Author:** ![JTSONLINE](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/jtsonline/32/279466_2.png) [@JTSONLINE](https://forums.plex.tv/u/JTSONLINE)\
**Post date:** [June 16, 2022, 9:37pm UTC](https://forums.plex.tv/t/remove-play-history/797332/6 "2022-06-16T21:37:24Z")

</div>

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 🙂

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

---

<div class="post-metadata">

**Author:** ![ChuckPa](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/chuckpa/32/79710_2.png) [@ChuckPa](https://forums.plex.tv/u/ChuckPa)\
**Post date:** [June 16, 2022, 9:53pm UTC](https://forums.plex.tv/t/remove-play-history/797332/7 "2022-06-16T21:53:18Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![JTSONLINE](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/jtsonline/32/279466_2.png) [@JTSONLINE](https://forums.plex.tv/u/JTSONLINE)\
**Post date:** [June 16, 2022, 10:23pm UTC](https://forums.plex.tv/t/remove-play-history/797332/8 "2022-06-16T22:23:32Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)\
**Post date:** [September 14, 2022, 10:23pm UTC](https://forums.plex.tv/t/remove-play-history/797332/9 "2022-09-14T22:23:57Z")

</div>

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