Can I delete just the activities from a single Garmin device from my Garmin Connect account?

Former Member
Former Member

Before going on a cycling holiday, I uploaded the routes to mine and a friend's Garmin 820s.  He also asked for me to update his device, as he rarely attaches it to his PC.

Whilst I connected his 820 to my PC, it has sync'ed all his rides to my G-Connect account.  As we ride together a lot, there are some very similar rides and telling the 100s of activities apart is going to takes ages...

Is there a way of sorting the data by a unique identifier, such as device serial number, so I can remove all his activities from my account, without reading each one to compare start and finish locations?

Any assistance would be appreciated.

  • EDIT:

    July 23, 2025: deleted original python script which doesn't work anymore. Added new browser script


    Here's a script which works from your browser (e.g. Chrome or Firefox)

    Obtain device ID (for activities to be deleted):

    1) From the watchface, open the menu (hold UP on most watches)

    2) Depending on the watch, select:

    System > About

    Settings > System > About

    Watch Settings > System > About

    3) Take note of the Unit ID on the first page - it's a number

    If you don't have access to the device:

    - Open an activity that was created by that device in the Garmin Connect website

    - Open the developer console. Copy and paste the script at https://pastebin.com/raw/0Jx42mQk. (See steps 5 to 9 below)

    - The script will automatically run and display the device ID associated with the opened activity

    Delete activities:

    4) Open connect.garmin.com in a browser and log in to Garmin Connect

    5a) Open a new tab

    5b) Open https://pastebin.com/raw/7ZNWcBDn

    [this is the script for deleting activities]

    5c) Select all the text and copy it to your clipboard - Windows: CTRL-A, CTRL-C | Mac : CMD-A, CMD-C

    6) Switch to your Garmin Connect tab and open the developer tools - Windows: CTRL-SHIFT-I | Mac: CMD-SHIFT-I

    7) Select the Console tab

    8) If you are using Chrome, type the following line and press ENTER/RETURN:

    allow pasting

    9) Paste the code you copied in step 5) - Windows: CTRL-V | Mac: CMD-V. Press ENTER/RETURN

    10) Enter the following line into the console (replace 1234 with the actual device ID), and press ENTER/RETURN

    deleteGarminConnectActivities(1234, "show")

    This will list activities which match device 1234, but not actually delete them.

    11) If you are absolutely sure you want to delete those activities, enter the following line and press ENTER/RETURN. You will not be asked for confirmation and there is no way to undo the deletion, so please be careful.

    deleteGarminConnectActivities(1234, "delete")

  • Former Member
    0 Former Member over 6 years ago in reply to WillNorthYork

    Thanks for the reply WillNorthYork...

    I managed to do everything down to the last sentence...  When I run the script (on a Mac) three windows open, but none are asking for any details.  I have:

    WINDOW 1, CALLED:  "D***** --- -bash 80x24" window, which says:

    Last login: Mon Jun 24 16:52:09 on ttys000

    D*****-iMac:~ d*****$ 

    WINDOW 2, CALLED ""D***** --- pythonw ~/Downloads/gc-deletebydevice.py --- 80x24" window which says:

    Last login: Mon Jun 24 16:52:09 on ttys000

    cd '/Users/d*****/Downloads/' && '/usr/bin/pythonw'  '/Users/d*****/Downloads/gc-deletebydevice.py'  && echo Exit status: $? && exit 1

    D******-iMac:~ d*****$ cd '/Users/d******/Downloads/' && '/usr/bin/pythonw'  '/Users/d*****/Downloads/gc-deletebydevice.py'  && echo Exit status: $? && exit 1

    Traceback (most recent call last):

      File "/Users/d******/Downloads/gc-deletebydevice.py", line 41, in <module>

        import http.cookiejar

    ImportError: No module named http.cookiejar

    Press ENTER to exit.

    WINDOW 3 is the preferences for PythonW

    I cannot see anywhere to enter my details.  I only started using a Mac recently... Am I missing something?

    Thanks...  

  • Former Member Based on that error message in window 2, the script is being run with Python 2 instead of Python 3. Sorry about that.

    Try this instead.

    1) Open the Terminal app

    2) Type:

    cd ~/Downloads

    python3 gc-deletebydevice.py

  • Former Member
    0 Former Member over 5 years ago

    Thanks! Worked like a charm.

    An easier way to query the device ID is to look in the "about" settings menu directly on the watch.

  • Former Member
    0 Former Member over 5 years ago

     Thanks for this code. I did something similar and synced a watch I had bought before I realized the previous owner had not cleared it. While it was great that it looked like I had run the NYC Marathon, it just wasn't so! :-)

    This worked perfectly to clear up the data.

  • Former Member
    0 Former Member over 4 years ago in reply to WillNorthYork

    Hi there, thanks so much for this - this fix is (almost) a godsend for me after making a massive syncing error and now I have years of my wife's data merged in my account. However when I run the script, I get this error at the end - any idea how to get around this please? 

    urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1122)>

  • I"m also trying to do this, but getting a lot of errors like this

    File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 517, in open

        response = self._open(req, data)

     

    Please can you help?

  • I found the answer - you are my total superhero :) thank you so much! 

  • What is the answer? I get the same errors when trying to run the script to delete the files. Thank you!

  • For everyone who's encountering SSL / request.py errors, I uploaded a new version. Refer to original comment: forums.garmin.com/.../901884

    For those who are interested, the fix is this:

    # workaround for SSL certificate error
    
    import ssl
    ssl._create_default_https_context = ssl._create_unverified_context
    

    stackoverflow.com/.../53310545