Skip to content

Instantly share code, notes, and snippets.

@skobkin
Last active February 13, 2023 17:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skobkin/ae1b30468ff94bdd1c01e6153aa32639 to your computer and use it in GitHub Desktop.
Save skobkin/ae1b30468ff94bdd1c01e6153aa32639 to your computer and use it in GitHub Desktop.
Removing all visible posts from VK.com profile
// 1. Scroll down your profile page as much as you can
// 2. Selecting "Delete" links (for English localization). It will not work on Russian language unless you change this: link.textContent === 'Delete post'
let links = [...document.querySelectorAll('a.ui_actions_menu_item')].filter(link => link.textContent === 'Delete post');
// 3. Removing last N posts if you want to keep them. One comma for each of RECENT posts to be left undeleted.
let [,,,,,,,,,,,,, ...removeLinks] = links;
// 4. Extracting wall.deletePost() calls
let codes = removeLinks.map(element => element.getAttribute('onclick'));
// 5. Calling them each 1000 milliseconds
codes.forEach(code => setTimeout(function() {eval(code)}, 1000));
// 6. Reload page
// 7. Repeat for any remaining posts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment