Reply
Trusted Contributor
hemm
Posts: 423
Accepted Solution

Purge chatter feed

I was wondering how I would go about deleting Chatter Feed data.  In an org of a client where auto-follow is on, it auto-followed way too many records and now the feed is unusable and takes up a lot of space.

 

Curious if there's a way to delete the Chatter feed records.  According the to API, I am seeing objects as selectable and deletable, but when I try through the System Log, I get errors that those objects don't support that.

 

How can I go about running a quick System Log script to delete Chatter feed records?

Trusted Contributor
hemm
Posts: 423

Re: Purge chatter feed

Figured it out. You have to query up each object's feed and delete those.  Example on leads.

 

 

list<leadfeed> l = new list<leadfeed>();
for (leadfeed lf : [select id from leadfeed limit 1000]){
l.add(lf);
}
delete l;

 

 

Trusted Contributor
jrotenstein
Posts: 244

Re: Purge chatter feed

Mmm, I tried running the sample code above, but I got an error that I couldn't use the "LeadFeed" object.

 

Has anybody else had success purging Chatter feed records?

John Rotenstein (Sydney, Australia)
Visit my Force.com blog: http://theEnforcer.net
Trusted Contributor
jrotenstein
Posts: 244

Re: Purge chatter feed

Aha! I figured it out.

 

Chatter needs to be turned on in Customize/Chatter/Settings. This will then make objects like AccountFeed and OpportunityFeed available to the System Log and Data Loader.

 

Now I've just got to get rid of my 16 million records!

John Rotenstein (Sydney, Australia)
Visit my Force.com blog: http://theEnforcer.net
Trusted Contributor
jrotenstein
Posts: 244

Re: Purge chatter feed

An alternative method is to use the Data Loader with the Bulk API to extract and then delete records. This works extremely fast and is great if you've got millions of records to delete!

 

A full write-up on the process can be found at: http://theenforcer.net/2010/11/too-much-chatter/

John Rotenstein (Sydney, Australia)
Visit my Force.com blog: http://theEnforcer.net