Samsara Web Design & Optimisation
Random header image... Refresh for more!

iMacro Code to Delete Facebook Messages

Here is the iMacro code that worked pretty quickly for deleting all my archived Facebook messages and chats. Just copy and paste the code below into an iMacro file and save with your preferred name. Then (whilst logged into Facebook) double click the file in iMacros to run the script.

Firstly if you do not have it the iMacros plugin for Firefox can be found through a link on this page
Then add the following code into an iMacro file (.iim) and save with a new name. Please check the build number in one of your exisiting sample iMacro files as if you have a different build you may have to change this.

Please note the code below no longer works due to Facebook making changes to their code. New code is here .. Delete Facebook Messages From Inbox

Code edited to overcome more Facebook changes on 29/06/2011

VERSION BUILD=7220523 RECORDER=FX
URL GOTO=https://www.facebook.com/#!/?sk=inbox&query=is%3Aarchived
TAG POS=1 TYPE=STRONG ATTR=TXT:*a*
WAIT SECONDS=1
SET !ERRORIGNORE YES

TAG POS=1 TYPE=SPAN ATTR=TXT:Actions
TAG POS=1 TYPE=SPAN ATTR=TXT:Delete<SP>messages…
TAG POS=1 TYPE=SPAN ATTR=TXT:Delete<SP>all
WAIT SECONDS=1
TAG POS=1 TYPE=INPUT:BUTTON ATTR=NAME:delete&&VALUE:Delete<SP>conversation

URL GOTO=https://www.facebook.com/#!/?sk=inbox&query=is%3Aarchived
WAIT SECONDS=1
TAG POS=1 TYPE=STRONG ATTR=TXT:*e*
WAIT SECONDS=1
SET !ERRORIGNORE YES

TAG POS=1 TYPE=SPAN ATTR=TXT:Actions
TAG POS=1 TYPE=SPAN ATTR=TXT:Delete<SP>messages…
TAG POS=1 TYPE=SPAN ATTR=TXT:Delete<SP>all
WAIT SECONDS=1
TAG POS=1 TYPE=INPUT:BUTTON ATTR=NAME:delete&&VALUE:Delete<SP>conversation

URL GOTO=https://www.facebook.com/#!/?sk=inbox&query=is%3Aarchived
WAIT SECONDS=1
TAG POS=1 TYPE=STRONG ATTR=TXT:*i*
WAIT SECONDS=1
SET !ERRORIGNORE YES

TAG POS=1 TYPE=SPAN ATTR=TXT:Actions
TAG POS=1 TYPE=SPAN ATTR=TXT:Delete<SP>messages…
TAG POS=1 TYPE=SPAN ATTR=TXT:Delete<SP>all
WAIT SECONDS=1
TAG POS=1 TYPE=INPUT:BUTTON ATTR=NAME:delete&&VALUE:Delete<SP>conversation

URL GOTO=https://www.facebook.com/#!/?sk=inbox&query=is%3Aarchived
WAIT SECONDS=1
TAG POS=1 TYPE=STRONG ATTR=TXT:*o*
WAIT SECONDS=1
SET !ERRORIGNORE YES

TAG POS=1 TYPE=SPAN ATTR=TXT:Actions
TAG POS=1 TYPE=SPAN ATTR=TXT:Delete<SP>messages…
TAG POS=1 TYPE=SPAN ATTR=TXT:Delete<SP>all
WAIT SECONDS=1
TAG POS=1 TYPE=INPUT:BUTTON ATTR=NAME:delete&&VALUE:Delete<SP>conversation

URL GOTO=https://www.facebook.com/#!/?sk=inbox&query=is%3Aarchived
WAIT SECONDS=1
SET !ERRORIGNORE YES
TAG POS=1 TYPE=STRONG ATTR=TXT:*u*
WAIT SECONDS=1
SET !ERRORIGNORE YES

TAG POS=1 TYPE=SPAN ATTR=TXT:Actions
TAG POS=1 TYPE=SPAN ATTR=TXT:Delete<SP>messages…
TAG POS=1 TYPE=SPAN ATTR=TXT:Delete<SP>all
WAIT SECONDS=1
TAG POS=1 TYPE=INPUT:BUTTON ATTR=NAME:delete&&VALUE:Delete<SP>conversation

URL GOTO=https://www.facebook.com/#!/?sk=inbox&query=is%3Aarchived
WAIT SECONDS=1
SET !ERRORIGNORE YES

Code edited to overcome more Facebook changes on 29/06/2011

The steps then required are: -
Go to Messages Inbox
Move individual messages to archive folder by pressing the ‘x’ on the right hand side (It is very fast and easy to go through your messages with one click for each)
Go to Messages Archived Folder
Run iMacro script file

Back to ‘Delete Facebook Messages

11 comments

1 TJ { 06.20.11 at 8:31 am }

Didn’t work for me.
6/20/2011

2 365 { 06.20.11 at 9:37 am }

Works for me, where did it fail?
What error message do you get?

3 aleksis { 06.27.11 at 9:19 am }

It doesn’t work. No error msg, goes correctly to the archives even if the start is inbox, but does not delete them.

4 365 { 06.29.11 at 12:53 pm }

Facebook had changed their button text code. Edited the code now so should be working again. Please can you try and let me know?

5 Sumit { 07.22.11 at 2:51 am }

thanks a lot this. this was really good learning experience for me. Using iMarco i recorded my own script and with the help of script provided by you.. i changed mine script and executed in the loop and deleted more and 5 month old all the saved message. here is my script. once again thanks a lot.

6 Anon { 07.29.11 at 4:55 am }

Could you fix it again?

7 abelard58 { 08.05.11 at 10:42 pm }

Would anyone know how to write a macro for deleting the “hidden” Message Archive – which Facebook keeps (even after we “delete” our Message conversations)? We can delete all we want – but everything is still in an HTML folder inside our personal “Facebook data” file – which you can download in Account Settings. It’s pretty horrid that FB keeps everything we write in such a file, and doesn’t allow us to *truly* delete old communications.

Anyone?

8 Lawrence { 08.10.11 at 10:15 am }

using iMacro 7.3.0.0 and the code doesn’t seem to work (tried it today 10 Aug 2011). it takes me in to my Archived messages view, but nothing gets deleted.

9 Nicole { 08.12.11 at 6:32 pm }

It doesn’t work for me either. Looks like it’s running, but then doesn’t delete anything. Does it require another update? Thanks!

10 365 { 08.24.11 at 7:19 pm }

Lawrence
Can you try again with Serkan’s code?
on this page.. http://www.samsaraweb.com/web-pc-help/delete-facebook-messages/

11 365 { 08.24.11 at 7:24 pm }

Thanks Sumit, what was the script that worked for you?

Leave a Comment