Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Bulk delete activities in Garmin Connect
function foo() {
console.log("foo - start")
$("button.search-button").click()
setTimeout(function() {
var li = $(".list-item")[0]
var delButton = $(li).find("button.js-activity-delete")
var confirmDelButton = $(li).find("button.delete-yes")
console.log(delButton, confirmDelButton)
$(delButton).click()
setTimeout(function() {
$(confirmDelButton).click()
console.log("foo - end")
}, 100)
}, 2000)
}
setInterval(foo, 3000)
@romecode
Copy link

romecode commented Dec 23, 2018

Nice!

Loading

@panterch
Copy link

panterch commented Dec 24, 2018

Thanks

Loading

@lordmat0
Copy link

lordmat0 commented Jul 16, 2019

Loading

@JoffVerby
Copy link

JoffVerby commented Aug 28, 2019

Thanks so much, this has been annoying me for ages.

Loading

@tony-gutierrez
Copy link

tony-gutierrez commented Sep 24, 2019

Much faster:


//go to activity page first. click search as the activity list gets low. 

var jq = document.createElement('script');
jq.src = "https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js";
document.getElementsByTagName('head')[0].appendChild(jq);
// ... give time for script to load
jQuery.noConflict();

function foo() {
    var li = $(".list-item").not('.fadeOut')[0];
    var delButton = $(li).find("button.js-activity-delete");
    var confirmDelButton = $(li).find("button.delete-yes");

    $(delButton).click();

    setTimeout(function() {
      $(confirmDelButton).click();
    }, 100);
}

setInterval(foo, 500);

Loading

@tasgray
Copy link

tasgray commented May 20, 2020

Thank you!

Loading

@colinlord
Copy link

colinlord commented Jul 10, 2020

Thanks everybody!

Loading

@wagn1184
Copy link

wagn1184 commented Nov 20, 2020

Can someone explain to me how to actually run this script? (Im kindof a noob)

Loading

@shrayasr
Copy link
Author

shrayasr commented Nov 23, 2020

Can someone explain to me how to actually run this script? (Im kindof a noob)

Sure thing.

So you first have to open the javascript console of your browser. Here is a link for that.

And once you have done that, first paste in this code:

var jq = document.createElement('script');
jq.src = "https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js";
document.getElementsByTagName('head')[0].appendChild(jq);
// ... give time for script to load, then type (or see below for non wait option)
jQuery.noConflict();

This will ensure that you have jQuery on the page which is a requirement for you to run this script.

Once that is done, you can copy the script in the gist above, paste it in the console, hit enter and it will start deleting all your garmin connect activities.


Edit: You can also use the script that @tony-gutierrez has commented to go faster

Loading

@JohnBateson
Copy link

JohnBateson commented Dec 13, 2020

Awesome, that just saved me a ton of time! Thank you all.

Loading

@totem95d
Copy link

totem95d commented Dec 24, 2020

really great, new on Garmin connect, I bought a used device and it import all the activities from the previous owner. Thanks !

Loading

@arpatoz
Copy link

arpatoz commented Jan 27, 2021

This is really great! Is there any similar way to bulk delete all the body weight (or any measurement) entries from Garmin Connect.

I happened to import 8 years of weight data into GConnect from FitBit, but entered them as kg instead of pound. :(( Now, I have 700+ entries to delete.

Loading

@wagn1184
Copy link

wagn1184 commented Jan 27, 2021

Yes but you are likely going to have to make the program yourself (easier than it might sound). You can use a macro automation program where you record yourself completing the task (deleting a single weight) and then the program can replay this over and over. Pulover’s Macro Creator should work for this https://www.macrocreator.com/
Also if you are familiar with python you can use the pyautogui library to automate tasks.

Loading

@ElMichel
Copy link

ElMichel commented Jun 16, 2021

Thx a lot. This is incredible time saver

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment