Earlier today I decided to clear out all of my existing tweets and start over again. After looking around for a bit on Twitter, I saw that my options were to either delete my account entirely (and lose all of my contacts) or delete all of my tweets one by one. Neither one of these was an acceptable solution to the problem, so I took two minutes to do it in CF.
I know this is really only useful in somewhat rare circumstances, but if you need it, now you have something to copy / paste.
<cfhttp method="GET" url="http://twitter.com/statuses/user_timeline/foo.xml?count=200" username="foo" password="blarg" /> <cfset theList = xmlParse(cfhttp.fileContent) /> <cfset loopCount = arrayLen(theList.statuses.status) /> <cfloop from="1" to="#loopCount#" index="i"> <cfhttp method="post" url="http://twitter.com/statuses/destroy.xml" username="foo" password="blarg"> <cfhttpparam type="formField" name="id" value="#theList.statuses.status[i].id.xmlText#" /> </cfhttp> </cfloop>
Just change ‘foo’ to your Twitter username and ‘blarg’ to your Twitter password and all should be good. As it stands this will run through and delete 200 tweets each time the script is executed. You could always enclose the whole thing in another loop that keeps going until you’re all wiped out if you want.
Also, this takes longer than 60 seconds to run, so if you have a 60 second execution timeout on your server it’s going to throw an exception. Either way, it saved me a metric assload of time this morning.
UPDATE: In the time since this was posted, Twitter has switched to requiring OAuth for all API calls, which means this will not work any longer. Hopefully it was helpful to a person or two while it worked.

#1 by Jake Munson on July 27, 2009 - 1:46 PM
Quote
Hey, can you modify that to mass-delete Twitter? ;)
#2 by Scott on July 27, 2009 - 2:29 PM
Quote
Sure…if you can get me a comma-delimited list of usernames and passwords :-P
#3 by Aye on August 4, 2009 - 1:12 AM
Quote
How do I use this? I don’t know what to put it in.
#4 by Scott on August 5, 2009 - 11:48 PM
Quote
You need to have access to a web server that is running ColdFusion. You then just paste that code into a blank file (killtweets.cfm for example) and change the cfhttp attributes to your twitter username and password. Then you load the page up in your browser, and you’re good to go.
If you don’t have access to a ColdFusion hosting environment, don’t worry. I’ll have something everyone can use online in a day or two.
#5 by suavenyc72 on October 28, 2009 - 7:50 PM
Quote
Can you help me out to delete a whole bunch of tweets one of these automated posting app did on my twitter?I just want to be able to bulk delete my tweets
#6 by Luis on October 31, 2009 - 6:11 AM
Quote
“If you don’t have access to a ColdFusion hosting environment, don’t worry. I’ll have something everyone can use online in a day or two.” ??????? PLEASE HELP
#7 by Brian on January 31, 2010 - 9:36 AM
Quote
Any chance you have the app ready for those of us who don’t have access to ColdFusion?
#8 by Allen on August 7, 2009 - 4:41 PM
Quote
I would like this as well. I’m looking to start from scratch without getting rid of my contacts. I used TwitterFeed and some other automated stuff and now I have more than 4500 tweets and only 2,000 followers. Glad you’re working on this Scott. Much appreciated.
#9 by Guy on February 5, 2010 - 1:33 AM
Quote
what other things can you use to get your tweets down???
#10 by meeks on August 15, 2009 - 9:32 AM
Quote
hey – so did we get any headway on a webserver that runs coldfusion for everyone? thank you in advance, Scott. i would really love the chance to mass delete my old tweets.
#11 by Joshua on October 21, 2009 - 10:46 PM
Quote
Do you have something everyone can use online yet for those who don’t have access to a server with coldfusion?
#12 by Варвара Евдокимовна on November 11, 2009 - 5:24 PM
Quote
Вечер добрый. Вот меня, как консультанта из Минска, волнует вопрос о отношении к нам, так сказать к тем, кто только начинает свою карьеру… Поговаривают, что в других регионах в случае праздников, консультантов поздравляют, дарят что-то ценное, а не обходятся банальной открыткой, как это делается у нас… Ведь это же бесспорно и приятно и понимаешь, что тебя хотя бы каплю, но уважают. Расскажите, как у Вас с этим?
#13 by Woucceets on December 31, 2009 - 5:16 PM
Quote
C наступающим Вас! Пусть Ваши мечты сбудутся!
#14 by John on January 1, 2010 - 11:26 AM
Quote
This is awesome, I just wish I was a bit more geeky to understand how to do this!
I did a bit more routing after reading this in hope I could find something for dumbasses like myself. And well, I did;
http://twitwipe.aalaap.com/ Works wells, but don’t even bother using while you’re working as it will drive you nuts as there is a warning pop up every 20 seconds or so just to let you now it’s still ‘wiping’, thus, brings it back as the top window. Trés annoying!
#15 by mal on January 22, 2010 - 7:00 PM
Quote
i agree with john twitwipe is good but if you have auto clicker v2.1by shocker you set it up to auto click the message and leave the pc running and it sorts it, and it is free
#16 by Mak on April 23, 2010 - 12:17 AM
Quote
Thanks Scott…wonderful script.
#17 by Aspiring Geek on July 28, 2010 - 12:24 AM
Quote
I’m currently working on re-writing this code in .php so more people can actually use the code since coldfusion is expensive and not available on most hosting services.
I appreciate the code, since I am a student, I plan on using this code in many ways.
#18 by Aspiring Geek on July 28, 2010 - 12:25 AM
Quote
Twitwipe, it’s absolute crap. It’s horribly buggy. I’m sure this script actually works better than that crap.
Pingback: 删除所有Tweet的方法 | 生命不息折腾不止
#19 by Mark on May 14, 2011 - 10:40 PM
Quote
Hey dude.
We have an app on twitter and a php server and we want to auto delete twitter statuses which are older than a given date when the app runs. Got any code suggestions at all for that?
#20 by Aming on July 4, 2011 - 3:48 AM
Quote
@Aspiring Geek: can u share your script please.. thanks a lot