Automatically delete tweets and remove reposts from your X/Twitter account. This script uses Selenium to automate the process of cleaning up your X/Twitter timeline.
- Deletes tweets and removes reposts
- Works with the latest X/Twitter interface
- Handles rate limiting and dynamic loading
- Secure password input
- Automatic scrolling and content detection
- Python 3.6 or higher
- Chrome browser
- ChromeDriver matching your Chrome version
- pip (comes with Python on Windows, use pip3 on macOS)
- Clone this repository:
git clone https://github.com/xzrfax/X-Twitter-Clean.git
cd X-Twitter-Clean
- Create and activate a virtual environment (recommended):
# Windows:
python -m venv venv
venv\Scripts\activate
# macOS/Linux:
python3 -m venv venv
source venv/bin/activate
- Install required packages:
# Windows:
pip install -r requirements.txt
# macOS/Linux:
pip3 install -r requirements.txt
- Install ChromeDriver:
- Download the version matching your Chrome browser from ChromeDriver Downloads
- Add it to your system PATH
- Run the script:
# Windows:
python twitter_delete.py
# macOS/Linux:
python3 twitter_delete.py
- Enter your X/Twitter username when prompted
- Enter your password (input will be hidden)
- Let the script run - it will automatically scroll through your profile and remove tweets/reposts
- Press Ctrl+C at any time to stop the script
- The script logs into your X/Twitter account using the provided credentials
- It scrolls through your profile, looking for tweets and reposts
- For each tweet found, it clicks the menu and delete buttons
- For each repost found, it clicks the repost button to undo it
- The script handles dynamic loading and rate limiting automatically
- Your password is never stored or logged
- The script runs in incognito mode
- No data is collected or transmitted except to X/Twitter
- All automation is done through official X/Twitter web interfaces
- If the script fails to start, ensure ChromeDriver matches your Chrome version
- If login fails, check your credentials
- If the script seems stuck, try restarting it
- For other issues, check the error messages in the console
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
This script is not affiliated with X/Twitter. Use at your own risk. The author is not responsible for any account restrictions or other consequences of using this script.