Skip to content

Instantly share code, notes, and snippets.

@amalmurali47
Created May 1, 2019 18:31
Show Gist options
  • Save amalmurali47/e4bfcc9e0df17a27cf799c78558e6cf6 to your computer and use it in GitHub Desktop.
Save amalmurali47/e4bfcc9e0df17a27cf799c78558e6cf6 to your computer and use it in GitHub Desktop.
Delete all Telegram contacts.

How to delete all your Telegram contacts at once?

  1. Go to https://web.telegram.org and sign in if you're not already signed in.
  2. On the top-left, click on the hamburger icon to show the dropdown menu, and choose "Contacts" from the list.
  3. Choose "Edit".
  4. Open the Developer Console of your browser (preferably Chrome or Firefox). On Chrome, that is Ctrl + Shift + J.
  5. Run the following JS snippet:
var x = document.getElementsByClassName('contacts_modal_contact')
for (i=0; i<x.length; i++) {
    x[i].click();
}
  1. It selects all your contacts. Click on the "Delete" button.
@urmilshroff
Copy link

Thank you for this! Worked like a charm.

@amalmurali47
Copy link
Author

@urmilshroff Glad this helped you! :)

@MstrZeroOne
Copy link

How can I add all group members in my contacts?

@PfanP
Copy link

PfanP commented Oct 6, 2020

Awesome!

@AtharvaChavan
Copy link

Thx bro!!!!

@pipinstallpypi
Copy link

Thanks

@gupta-shrinath
Copy link

Thanks mate 👍

@akbarali1
Copy link

Thanks

@chagai95
Copy link

Hey, this was great I thought but I realized that they somehow still have access to my contacts, even newer contacts! I removed all sessions and then logged in again with telegram web and deleted all contacts, I still get a notification when one of my contacts joins telegram - and they have this extremely annoying bug where I can't even turn these notifications off, and I have a LOT of contacts...

@pavanghai
Copy link

Thanks This was helpful, how do leave the group?

@amalmurali47
Copy link
Author

@pavanghai That should be similar.

@galvin96
Copy link

galvin96 commented May 30, 2021

This action below to delete all contacts on telegram:

  1. On the top-left, click on the hamburger icon to show the dropdown menu, and choose "Contacts" from the list.
  2. Run this code:
var x = document.getElementsByClassName('contacts_modal_contact')
setInterval(() => {
  document.getElementsByClassName('md_modal_action')[1].click()
  for (i=0; i<x.length; i++) {
      x[i].click();
  }
  document.getElementsByClassName('btn btn-md btn-md-danger')[0].click()
}, 1000)

@asifulhoq
Copy link

what about leaving multiple group?

@oleg-rom
Copy link

oleg-rom commented Jan 8, 2022

This doesn't work on latest version as of jan 2022.

@abbasudo
Copy link

This doesn't work on latest version as of jan 2022.

@oleg-rom from the top menu you have to chose the switch to old version since the new version dosent support editing contacts

image

@a-v-ebrahimi
Copy link

It's not there any more, just A version and K version

@inkardash
Copy link

It's not there any more, just A version and K version

https://web.telegram.org/?legacy=1

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