diff --git a/api/funkwhale_api/common/scripts/__init__.py b/api/funkwhale_api/common/scripts/__init__.py
index c1fd39e619a016708dd629962e8a6411a8e31714..7c468d9849c9c801c08cece808e85de44118ef25 100644
--- a/api/funkwhale_api/common/scripts/__init__.py
+++ b/api/funkwhale_api/common/scripts/__init__.py
@@ -2,6 +2,7 @@ from . import create_actors
 from . import create_image_variations
 from . import django_permissions_to_user_permissions
 from . import migrate_to_user_libraries
+from . import delete_pre_017_federated_uploads
 from . import test
 
 
@@ -10,5 +11,6 @@ __all__ = [
     "create_image_variations",
     "django_permissions_to_user_permissions",
     "migrate_to_user_libraries",
+    "delete_pre_017_federated_uploads",
     "test",
 ]
diff --git a/api/funkwhale_api/common/scripts/delete_pre_017_federated_uploads.py b/api/funkwhale_api/common/scripts/delete_pre_017_federated_uploads.py
new file mode 100644
index 0000000000000000000000000000000000000000..527b5c7b2fb3cb9f0e6c7ca046db3200370fbc1f
--- /dev/null
+++ b/api/funkwhale_api/common/scripts/delete_pre_017_federated_uploads.py
@@ -0,0 +1,14 @@
+"""
+Compute different sizes of image used for Album covers and User avatars
+"""
+
+from funkwhale_api.music.models import Upload
+
+
+def main(command, **kwargs):
+    queryset = Upload.objects.filter(
+        source__startswith="http", source__contains="/federation/music/file/"
+    ).exclude(source__contains="youtube")
+    total = queryset.count()
+    command.stdout.write("{} uploads found".format(total))
+    queryset.delete()
diff --git a/api/tests/common/test_scripts.py b/api/tests/common/test_scripts.py
index 017caad70abf3fa0cb4733ba7746024b0966a473..930c502a369e9c80caec0758f8fce5d6b5bbde9a 100644
--- a/api/tests/common/test_scripts.py
+++ b/api/tests/common/test_scripts.py
@@ -12,7 +12,12 @@ def command():
 
 
 @pytest.mark.parametrize(
-    "script_name", ["django_permissions_to_user_permissions", "test"]
+    "script_name",
+    [
+        "django_permissions_to_user_permissions",
+        "test",
+        "delete_pre_017_federated_uploads",
+    ],
 )
 def test_script_command_list(command, script_name, mocker):
     mocked = mocker.patch("funkwhale_api.common.scripts.{}.main".format(script_name))
@@ -235,3 +240,17 @@ def test_migrate_to_users_libraries_command(
 
     for part in ["followers", "following"]:
         generate_actor_urls.assert_any_call(part, command.stdout)
+
+
+def test_delete_pre_017_federated_uploads(factories, command):
+    to_delete = factories["music.Upload"](
+        source="https://test.com/federation/music/file/1"
+    )
+    to_keep = factories["music.Upload"](source="https://hello.world")
+
+    scripts.delete_pre_017_federated_uploads.main(command)
+
+    to_keep.refresh_from_db()
+
+    with pytest.raises(to_delete.__class__.DoesNotExist):
+        to_delete.refresh_from_db()
diff --git a/changes/changelog.d/564.bugfix b/changes/changelog.d/564.bugfix
new file mode 100644
index 0000000000000000000000000000000000000000..9bb41829f7ef8df7a9fa89c980fcfac663e82a99
--- /dev/null
+++ b/changes/changelog.d/564.bugfix
@@ -0,0 +1 @@
+Added a script to prune pre 0.17 federated tracks (#564)
diff --git a/changes/notes.rst b/changes/notes.rst
index 2b4e847eb596ee717549f34491424bb2c2f34808..79e5158b166ff9e415aba6b4a03296236695c742 100644
--- a/changes/notes.rst
+++ b/changes/notes.rst
@@ -52,6 +52,25 @@ Funkwhale will successfully extract licensing data for the following licenses:
 Support for other licenses such as Art Libre or WTFPL will be added in future releases.
 
 
+
+Delete pre 0.17 federated tracks [manual action suggested]
+----------------------------------------------------------
+
+If you were using Funkwhale before the 0.17 release and federated with other instances,
+it's possible that you still have some unplayable federated files in the database.
+
+To purge the database of those entries, you can run the following command:
+
+On docker setups::
+
+    docker-compose run --rm api python manage.py script delete_pre_017_federated_uploads --no-input
+
+On non-docker setups::
+
+    python manage.py script delete_pre_017_federated_uploads --no-input
+
+
+
 Enable gzip compression [manual action suggested]
 -------------------------------------------------