A long time ago last.fm had an option to wipe all the history of scrobbling in the profile settings, then it was removed, but left the API-method through which it was possible to delete single listens. Most of the scripts that offer you to wipe your account work through the method
removeScrobble(), unfortunately, it was disabled in 2017.
The only remaining option is to delete the history through the web interface.
At this time (May 2022), I couldn’t find any working script for wiping scrobbling histories, so I wrote my own code in Python.
The script is quite simple, through Selenium we open the scrobbling library and call the JQuery code, which cyclically clicks the “Delete scrobble” button.
Next, wait 5 seconds, refresh the page and repeat the action.
In the code you need to change to your values
profile_path (path to User Data Directory) and link
You may need to increase the timeout time in
time.sleep() to avoid blocked by the server.