Skip to content

Instantly share code, notes, and snippets.

@0xOsprey
Last active May 19, 2025 09:54
Show Gist options
  • Save 0xOsprey/d750215e26eaeafa75f456e35063a3f6 to your computer and use it in GitHub Desktop.
Save 0xOsprey/d750215e26eaeafa75f456e35063a3f6 to your computer and use it in GitHub Desktop.
Script to mass remove all Twitter/X.com Interests
  1. Navigate to https://x.com/settings/your_twitter_data/twitter_interests
  2. Open Dev Tools in your browser
  3. Go to Console
  4. Copy and paste this code into the Browser console then hit enter and let it run
async function uncheckAllWithDelay(delayMs = 3000) {
  // Try standard checkboxes first
  const checkboxes = document.querySelectorAll('input[type="checkbox"]');
  
  // If no standard checkboxes, try custom elements (more likely on Twitter/X)
  const elements = checkboxes.length > 0 ? 
    checkboxes : 
    document.querySelectorAll('[role="checkbox"][aria-checked="true"]');
  
  console.log(`Found ${elements.length} checked items to uncheck`);
  
  let count = 0;
  
  // Process each element with delay
  for (const element of elements) {
    if ((element.checked || element.getAttribute('aria-checked') === 'true')) {
      element.click();
      count++;
      console.log(`Unchecked ${count} of ${elements.length}`);
      
      // Add delay to avoid rate limiting
      await new Promise(resolve => setTimeout(resolve, delayMs));
    }
  }
  
  console.log(`Completed! Unchecked ${count} items`);
}

// Run the function with a 3000ms delay (adjust as needed)
uncheckAllWithDelay(3000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment