[How to] Delete Rotten tomatoes reviews from the database (docker)

Hi fellow movie library organizers. As you noticed there is still no option to remove or disable the Rotten tomatoes reviews. There is a thread here on Plex forums where we can vote and give our opinion: Disable reviews

In the meantime I want to share an easy way for us docker users to delete all the rotten tomatoes reviews in the database and hide the review section. It works for locally installed Plex too, read the last section.

Part 1: Backup database

1 Backup the database (com.plexapp.plugins.library.db)

2 Make sure you backed up the database

Part 2: Manually delete reviews

1 Open up a shell into the docker container:

docker exec -it plexcontainername /bin/bash

2 Enter the database folder:

cd "/config/Library/Application Support/Plex Media Server/Plug-in Support/Databases/"

3 Search the database for all Rotten tomates reviews. The result shown will be deleted in the next step:

"/usr/lib/plexmediaserver/Plex Media Server" --sqlite com.plexapp.plugins.library.db "SELECT * FROM taggings WHERE extra_data LIKE '%rotten%'"

4 Delete the rows in the database:

"/usr/lib/plexmediaserver/Plex Media Server" --sqlite com.plexapp.plugins.library.db "DELETE FROM taggings WHERE extra_data LIKE '%rotten%'"

5 Enjoy a review free Plex library that is no longer rotten.

6 To avoid having the metadata automatically refreshed which brings back the reviews, disable the option under Server settings > Scheduled tasks: Refresh library metadata periodically

Part 3: Automatically delete reviews (optional)

Create a cron job that runs a script every X hours. Start by manually refreshing metadata on a movie so there is something to delete.

1 Create a bash script in the storage config directory. In my example /data/docker/plex/config

nano /data/docker/plexcontainername/config/remove_rotten.sh

2 Enter these lines:

#!/bin/bash
cd "/config/Library/Application Support/Plex Media Server/Plug-in Support/Databases/"
num=$("/usr/lib/plexmediaserver/Plex Media Server" --sqlite com.plexapp.plugins.library.db "SELECT * FROM taggings WHERE extra_data LIKE '%rotten%'" | wc -l )

echo Removing $num rotten tomatoes reviews
#"/usr/lib/plexmediaserver/Plex Media Server" --sqlite com.plexapp.plugins.library.db "DELETE FROM taggings WHERE extra_data LIKE '%rotten%'"

3 Enter the container and make the bash script executable:

docker exec -it plexcontainername /bin/bash
chmod +x /config/remove_rotten.sh

4 Exit the container (exit), then test run the script:

docker exec -it plexcontainername /bin/bash /config/remove_rotten.sh

Output: “Removing X rotten tomatoes reviews”

5 If the output is like the example above, remove the starting # (comment) on the last row in the script. On the next run the script will remove the reviews.

6 Schedule the bash script to run every hour with cron. There are multiple ways to do this, this is my preferred method.

crontab -e

Enter this line, which will run every hour:

0 * * * * /usr/bin/docker exec -t plexcontainername /bin/bash /config/remove_rotten.sh

7 Turn back on the option to automatically refresh metadata under Server settings > Scheduled tasks: Refresh library metadata periodically.

More information

Warning: Do not use sqlite3 or any other database tool, it will or might corrupt the database. Only the “Plex Media Server” --sqlite" command works.

This works if Plex is locally installed too, running steps 2-3 in Part 1. Replace the database path and “/usr/lib/plexmediaserver/Plex Media Server” --sqlite the path and executable Plex SQLite like the examples here: https://support.plex.tv/articles/repair-a-corrupted-database/.

Photos:
Before, reviews shown: Imgur: The magic of the Internet
After, reviews removed: Imgur: The magic of the Internet

3 Likes

@BigWheel Nominating this thread to the Tips, Tricks & How-Tos category

2 Likes

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