Facebook – Delete All Messages iMacro

With recent updates (Jan 2017) to Facebook inbox, basically replaced by Messenger several useful hacks have become obsolete (at the time of this post).

One of those useful hacks is/was “Delete All Messages” chrome extension, however it is not currently working at this time.

It will take some time to run this, as it just replicates the actions you would do to delete the messages one by one. So when your comfortable with it let it run when your away from your computer.

This hack can do similar job using “iMacros for Chrome“.

  • Install iMacros for Chrome (Tutorial Here)
  • Create a new macro or edit an existing macro
  • Copy the code into the new macro
  • Read the notes in the code

Credit for the code below goes to ConnorClarkLindh

'this script requires the free chrome imacros plugin to run (http://imacros.net/overview)'
'updates to facebook messenger interface will likely break this and it will need to be rebuilt using a new recorded imacro.'
'i tested this on windows 10 using the most updated chrome browser (stable) as of 14/1/2017, future updates may break this.'
'i recommend copy-pasting the delete code as many times as you want to delete in one sitting. I did 20 at a time.'
'i also recommend using "play loop" and setting a loop according to the number of messages you have to delete.
'The messeneger page will reload on every loop.'
VERSION BUILD=844 RECORDER=CR
URL GOTO=https://www.facebook.com/messages/

SET LOCATION 0
'Number of seconds can be adjust to suit you'
WAIT SECONDS=10
'Copy from here to the other comment'
ADD LOCATION 2
TAG POS=1 TYPE=DIV ATTR=ARIA-LABEL:Conversation<SP>actions&&CLASS:_5blh<SP>_4-0h<SP>_p&&ROLE:button&&TABINDEX:0&&TXT:
'Number of seconds can be adjust to suit you'
WAIT SECONDS = 6

TAG POS={{LOCATION}} TYPE=SPAN ATTR=TXT:Delete
'Number of seconds can be adjust to suit you'
WAIT SECONDS = 6

TAG POS=1 TYPE=EM ATTR=TXT:Delete
'Number of seconds can be adjust to suit you'
WAIT SECONDS = 6

'Copy to here'