Want to highlight a helpful answer? Upvote!

Did someone help you, or did an answer or User Tip resolve your issue? Upvote by selecting the upvote arrow. Your feedback helps others! Learn more about when to upvote >

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Deleting Messages.app history folders doesn't work

I am trying to script removing the Messages.app history folders.


I have tried removing three places as such:


rm -rf ~/Library/Containers/com.apple.iChat/Data/Library/Messages/*

rm -rf ~/Library/Containers/com.apple.iChat/Data/Library/Caches/*

rm -rf ~/Library/Messages/*

Those all delete just fine, but all of my history is still there when I open Messages.app

Where is it keeping this stuff - its like a zombie history that just keeps coming back again and again.

What other folders do I need to remove to clear this stuff out?

Posted on Oct 6, 2014 7:06 PM

Reply
7 replies

Oct 6, 2014 7:13 PM in response to John Reinhold

This may be a bit of a duplicate thread..

https://discussions.apple.com/thread/6489255


However:


I see this in my console when I restart Messages (emphasis added by me):


10/6/14 6:40:22.835 PM Messages[12742]: Chat history path /Users/[username]/Library/Containers/com.apple.iChat/Data/Library/Messages/Arch ive Status: 0 totalExpected: 0 countProcessed: 0, forcing an import.


Where the heck is it importing from, and how do we delete that?

Oct 7, 2014 12:42 PM in response to John Reinhold

Hi,


What "History" are you trying to remove ?


iMessages are stored in chat.db items in ~/Library/Messages and there are three that interact together.


Saved Chats (Set in the General Section of the Preferences > Save on Close) will Save the chat or conversation when the App is Quit, When the computer sleeps, if the computer is shut down with the App is open and when the Chat or conversation is dismissed from the list.


The chat.db items are the ones that are involved in "restoring" the iMessages "History" when you start a new chat with someone you have had contact with before.


The Saved Chats will work the same way for all saved chats, similar to the way the iMessages "History" works using the chat.db items.

(i.e. when you reconnect to the same person any Saved chat will be shown as well).


The items you seem to be removing are a bit over the top, but would seems to be aimed at clearing any sort of history to the app.


I am not aware of anywhere else that any history is held (I would not have emptied the Caches myself).


The Console log item is referring to Saved Chats in the subfolder called Archive within the Messages folder, deep within that Containers folder.

It would normally look for iMessages History via the Chat.db items (Or at least that is what I have always thought).


I am not sure what to suggest.



User uploaded file

8:42 pm Tuesday; October 7, 2014


 iMac 2.5Ghz i5 2011 (Mavericks 10.9)
 G4/1GhzDual MDD (Leopard 10.5.8)
 MacBookPro 2Gb (Snow Leopard 10.6.8)
 Mac OS X (10.6.8),
 Couple of iPhones and an iPad

Oct 8, 2014 11:17 AM in response to Ralph-Johns-UK

I want to delete all of my iMessage history that is on the computer. I don't want it keeping my messages forever - even after I remove the conversations from my phone. Removing them conversation by conversation in the Messages app is tedious, it takes multiple clicks for each conversation thread.


Even when I


rm -rf ~/Library/Containers/com.apple.iChat/Data/Library/Messages/*

rm -rf ~/Library/Containers/com.apple.iChat/Data/Library/Caches/*

rm -rf ~/Library/Messages/*


- my message conversations are all still there the next time I open the app. Where else could it be storing my message conversations?


I want to have a way to easily wipe all messages from my computer.

Oct 8, 2014 12:12 PM in response to John Reinhold

HI,


I must admit to not knowing enough about your Unix command codes to say if they are correct or not.


However they look correct.

Removing ~/Library/Messages would delete the chat.db items and the Attachments folder (where the Pics and Files that have been received are held)


That should delete the "history" from the iMessages Conversations in the main Messages window.

Similarly if you have been Save of Close then the removal of the contents of ~/Library/Containers/com.apple.iChat/Data/Messages would delete the Archive Folder which itself would hold the save files in dated folders.


Deleting the caches would seem to be sensible but I have never done it to "prove" this is involved when trying a simple relocation to see what happens.


You are doing this with the App Quit ?



User uploaded file

8:12 pm Wednesday; October 8, 2014


 iMac 2.5Ghz i5 2011 (Mavericks 10.9)
 G4/1GhzDual MDD (Leopard 10.5.8)
 MacBookPro 2Gb (Snow Leopard 10.6.8)
 Mac OS X (10.6.8),
 Couple of iPhones and an iPad

Oct 21, 2014 12:51 PM in response to JimN

Hi,


Are you using the Terminal app to remove the files ?


iMessages are saved in two ways.

One is the Save on Close and the other is the chat.db items

It is the chat.db items that restores the "history" to iMessages conversations if you have dismissed the previous conversations with that person.


What we have is what was the iChat way of Saving Chats and the iMessages way of working to show you the "history".
Strangely the Save Chat works the same way (it will display the last few IMs and then when you scroll up (back in time) it will display more of the chat.


This does mean that when Save on Close is used iMessages are saved two ways.

Stopping just Save on Close does not "delete" the chats from the chat.db items



User uploaded file

8:51 pm Tuesday; October 21, 2014


 iMac 2.5Ghz i5 2011 (Mavericks 10.9)
 G4/1GhzDual MDD (Leopard 10.5.8)
 MacBookPro 2Gb (Snow Leopard 10.6.8)
 Mac OS X (10.6.8),
 Couple of iPhones and an iPad

Deleting Messages.app history folders doesn't work

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.